kubeadm: fix golint warnings for redundant ifs

When golint is run against kubeadm it reports severel warnings like

    redundant if ...; err != nil check, just return error instead.

Fix the warnings by just returning error.
This commit is contained in:
Dmitry Rozhkov
2018-12-27 15:18:25 +02:00
parent aee1ab34ab
commit 0bf0b3ef1a
7 changed files with 7 additions and 31 deletions

View File

@@ -59,11 +59,7 @@ func CreatePKIAssets(cfg *kubeadmapi.InitConfiguration) error {
fmt.Printf("[certs] valid certificates and keys now exist in %q\n", cfg.CertificatesDir)
// Service accounts are not x509 certs, so handled separately
if err := CreateServiceAccountKeyAndPublicKeyFiles(cfg); err != nil {
return err
}
return nil
return CreateServiceAccountKeyAndPublicKeyFiles(cfg)
}
// CreateServiceAccountKeyAndPublicKeyFiles create a new public/private key files for signing service account users.