Skip to content

Commit 90481a9

Browse files
committed
fix kubeadm staticcheck err
1 parent 8b0a7de commit 90481a9

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

cmd/kubeadm/app/preflight/checks.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,7 @@ func getEtcdVersionResponse(client *http.Client, url string, target interface{})
803803
loopCount--
804804
return false, err
805805
}
806+
//lint:ignore SA5011 If err != nil we are already returning.
806807
defer r.Body.Close()
807808

808809
if r != nil && r.StatusCode >= 500 && r.StatusCode <= 599 {

cmd/kubeadm/app/util/config/cluster_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ func TestGetInitConfigurationFromCluster(t *testing.T) {
748748
// Test expected values in InitConfiguration
749749
if cfg == nil {
750750
t.Errorf("unexpected nil return value")
751+
return
751752
}
752753
if cfg.ClusterConfiguration.KubernetesVersion != k8sVersionString {
753754
t.Errorf("invalid ClusterConfiguration.KubernetesVersion")

0 commit comments

Comments
 (0)