Преглед изворни кода

Merge pull request #14046 from mattmoor/token-investigation

Unconditionally use AuthTransport.
Stephen Day пре 10 година
родитељ
комит
c7ece73fa4
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      registry/session.go

+ 3 - 3
registry/session.go

@@ -158,9 +158,9 @@ func NewSession(client *http.Client, authConfig *cliconfig.AuthConfig, endpoint
 		}
 		}
 	}
 	}
 
 
-	if endpoint.Version == APIVersion1 {
-		client.Transport = AuthTransport(client.Transport, authConfig, alwaysSetBasicAuth)
-	}
+	// Annotate the transport unconditionally so that v2 can
+	// properly fallback on v1 when an image is not found.
+	client.Transport = AuthTransport(client.Transport, authConfig, alwaysSetBasicAuth)
 
 
 	jar, err := cookiejar.New(nil)
 	jar, err := cookiejar.New(nil)
 	if err != nil {
 	if err != nil {