kubeadm: fix static check failures

This commit is contained in:
SataQiu
2019-08-23 10:51:12 +08:00
parent c369cf187e
commit 7a4cf591ea
6 changed files with 10 additions and 19 deletions

View File

@@ -38,14 +38,12 @@ import (
// Please note that this structure includes the public kubeadm config API, but only a subset of the options // 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. // supported by this api will be exposed as a flag.
type nodeOptions struct { type nodeOptions struct {
kubeConfigPath string kubeConfigPath string
kubeletVersion string kubeletVersion string
advertiseAddress string etcdUpgrade bool
nodeName string renewCerts bool
etcdUpgrade bool dryRun bool
renewCerts bool kustomizeDir string
dryRun bool
kustomizeDir string
} }
// compile-time assert that the local data object satisfies the phases data interface. // compile-time assert that the local data object satisfies the phases data interface.

View File

@@ -257,6 +257,9 @@ func (rm *Manager) CreateRenewCSR(name, outdir string) error {
// generates the CSR request and save it // generates the CSR request and save it
csr, key, err := pkiutil.NewCSRAndKey(cfg) csr, key, err := pkiutil.NewCSRAndKey(cfg)
if err != nil {
return errors.Wrapf(err, "failure while generating %s CSR and key", name)
}
if err := pkiutil.WriteKey(outdir, name, key); err != nil { if err := pkiutil.WriteKey(outdir, name, key); err != nil {
return errors.Wrapf(err, "failure while saving %s key", name) return errors.Wrapf(err, "failure while saving %s key", name)
} }

View File

@@ -213,7 +213,7 @@ func (poc PortOpenCheck) Check() (warnings, errorList []error) {
} }
} }
return nil, errorList return warnings, errorList
} }
// IsPrivilegedUserCheck verifies user is privileged (linux - root, windows - Administrator) // IsPrivilegedUserCheck verifies user is privileged (linux - root, windows - Administrator)

View File

@@ -23,9 +23,6 @@ import (
"strings" "strings"
) )
// dockerEndpoint is the os specific endpoint for docker communication
const dockerEndpoint = "unix:///var/run/docker.sock"
// DefaultSysSpec is the default SysSpec for Linux // DefaultSysSpec is the default SysSpec for Linux
var DefaultSysSpec = SysSpec{ var DefaultSysSpec = SysSpec{
OS: "Linux", OS: "Linux",

View File

@@ -23,9 +23,6 @@ import (
"strings" "strings"
) )
// dockerEndpoint is the os specific endpoint for docker communication
const dockerEndpoint = "npipe:////./pipe/docker_engine"
// DefaultSysSpec is the default SysSpec for Windows // DefaultSysSpec is the default SysSpec for Windows
var DefaultSysSpec = SysSpec{ var DefaultSysSpec = SysSpec{
OS: "Microsoft Windows Server 2016", OS: "Microsoft Windows Server 2016",

View File

@@ -5,10 +5,6 @@ cmd/controller-manager/app
cmd/kube-controller-manager/app cmd/kube-controller-manager/app
cmd/kube-proxy/app cmd/kube-proxy/app
cmd/kube-scheduler/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/linkcheck
cmd/preferredimports cmd/preferredimports
hack/make-rules/helpers/go2make/testdata/dir-with-gofiles hack/make-rules/helpers/go2make/testdata/dir-with-gofiles