We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 514da4b commit c5f869fCopy full SHA for c5f869f
docker/docker_client.go
@@ -265,7 +265,12 @@ func (c *dockerClient) setupRequestAuth(req *http.Request) error {
265
}
266
chs := parseAuthHeader(res.Header)
267
if res.StatusCode != http.StatusUnauthorized || chs == nil || len(chs) == 0 {
268
- // try again one last time with Basic Auth (gcr.io for instance)
+ if res.StatusCode == http.StatusOK {
269
+ return nil // gcr.io unauthenticated pull
270
+ }
271
+ // gcr.io authenticated pull requires us to send user:pass pair in
272
+ // order to retrieve a token
273
+ // try again one last time with Basic Auth
274
testReq2 := *req
275
// Do not use the body stream, or we couldn't reuse it for the "real" call later.
276
testReq2.Body = nil
0 commit comments