diff --git a/pkg/kubectl/resource/visitor.go b/pkg/kubectl/resource/visitor.go index 154f45c28ca..854e77c6a66 100644 --- a/pkg/kubectl/resource/visitor.go +++ b/pkg/kubectl/resource/visitor.go @@ -263,7 +263,7 @@ func readHttpWithRetries(get httpget, duration time.Duration, u string, attempts } // Error - Set the error condition from the StatusCode - if statusCode != 200 { + if statusCode != http.StatusOK { err = fmt.Errorf("unable to read URL %q, server reported %s, status code=%d", u, status, statusCode) } diff --git a/pkg/kubelet/config/http.go b/pkg/kubelet/config/http.go index 0a00607cc05..584c3894588 100644 --- a/pkg/kubelet/config/http.go +++ b/pkg/kubelet/config/http.go @@ -97,7 +97,7 @@ func (s *sourceURL) extractFromURL() error { if err != nil { return err } - if resp.StatusCode != 200 { + if resp.StatusCode != http.StatusOK { return fmt.Errorf("%v: %v", s.url, resp.Status) } if len(data) == 0 {