diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index d161e743ff6..95ff1c7cbce 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -803,6 +803,7 @@ func getEtcdVersionResponse(client *http.Client, url string, target interface{}) loopCount-- return false, err } + //lint:ignore SA5011 If err != nil we are already returning. defer r.Body.Close() if r != nil && r.StatusCode >= 500 && r.StatusCode <= 599 { diff --git a/cmd/kubeadm/app/util/config/cluster_test.go b/cmd/kubeadm/app/util/config/cluster_test.go index b768cdda93a..5e03ce09a04 100644 --- a/cmd/kubeadm/app/util/config/cluster_test.go +++ b/cmd/kubeadm/app/util/config/cluster_test.go @@ -748,6 +748,7 @@ func TestGetInitConfigurationFromCluster(t *testing.T) { // Test expected values in InitConfiguration if cfg == nil { t.Errorf("unexpected nil return value") + return } if cfg.ClusterConfiguration.KubernetesVersion != k8sVersionString { t.Errorf("invalid ClusterConfiguration.KubernetesVersion")