From c862d7c0e93c086f9d35e20ae5fccd9a4f5b8207 Mon Sep 17 00:00:00 2001 From: Hanna Lee Date: Thu, 15 Jul 2021 17:38:43 -0400 Subject: [PATCH] Fix last remaining SA5011 error by removing unnecessary r != nil check --- cmd/kubeadm/app/preflight/checks.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index 56ead258588..dc4ac9f17b3 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -808,10 +808,9 @@ 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 { + if r.StatusCode >= 500 && r.StatusCode <= 599 { loopCount-- return false, errors.Errorf("server responded with non-successful status: %s", r.Status) }