Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeadm: fix static check failures #81656

Merged
merged 1 commit into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 6 additions & 8 deletions cmd/kubeadm/app/cmd/upgrade/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ import (
// Please note that this structure includes the public kubeadm config API, but only a subset of the options
// supported by this api will be exposed as a flag.
type nodeOptions struct {
kubeConfigPath string
kubeletVersion string
advertiseAddress string
nodeName string
etcdUpgrade bool
renewCerts bool
dryRun bool
kustomizeDir string
kubeConfigPath string
kubeletVersion string
etcdUpgrade bool
renewCerts bool
dryRun bool
kustomizeDir string
}

// compile-time assert that the local data object satisfies the phases data interface.
Expand Down
3 changes: 3 additions & 0 deletions cmd/kubeadm/app/phases/certs/renewal/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ func (rm *Manager) CreateRenewCSR(name, outdir string) error {

// generates the CSR request and save it
csr, key, err := pkiutil.NewCSRAndKey(cfg)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also a good find

return errors.Wrapf(err, "failure while generating %s CSR and key", name)
}
if err := pkiutil.WriteKey(outdir, name, key); err != nil {
return errors.Wrapf(err, "failure while saving %s key", name)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeadm/app/preflight/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func (poc PortOpenCheck) Check() (warnings, errorList []error) {
}
}

return nil, errorList
return warnings, errorList
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good find :-)

}

// IsPrivilegedUserCheck verifies user is privileged (linux - root, windows - Administrator)
Expand Down
3 changes: 0 additions & 3 deletions cmd/kubeadm/app/util/system/types_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import (
"strings"
)

// dockerEndpoint is the os specific endpoint for docker communication
const dockerEndpoint = "unix:///var/run/docker.sock"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm going to assume unused package level constants with these.


// DefaultSysSpec is the default SysSpec for Linux
var DefaultSysSpec = SysSpec{
OS: "Linux",
Expand Down
3 changes: 0 additions & 3 deletions cmd/kubeadm/app/util/system/types_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import (
"strings"
)

// dockerEndpoint is the os specific endpoint for docker communication
const dockerEndpoint = "npipe:////./pipe/docker_engine"

// DefaultSysSpec is the default SysSpec for Windows
var DefaultSysSpec = SysSpec{
OS: "Microsoft Windows Server 2016",
Expand Down
4 changes: 0 additions & 4 deletions hack/.staticcheck_failures
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ cmd/controller-manager/app
cmd/kube-controller-manager/app
cmd/kube-proxy/app
cmd/kube-scheduler/app
cmd/kubeadm/app/cmd/upgrade
cmd/kubeadm/app/phases/certs/renewal
cmd/kubeadm/app/preflight
cmd/kubeadm/app/util/system
cmd/linkcheck
cmd/preferredimports
hack/make-rules/helpers/go2make/testdata/dir-with-gofiles
Expand Down