Make the v2 logic fallback on v1 when v2 requests cannot be authorized.

Signed-off-by: Matt Moore <mattmoor@google.com>
This commit is contained in:
Matt Moore
2015-06-02 21:22:59 -07:00
parent 7f6a7973cd
commit bd2575cc4f
3 changed files with 31 additions and 5 deletions
+4
View File
@@ -482,6 +482,10 @@ func (s *TagStore) pullV2Repository(r *registry.Session, out io.Writer, repoInfo
if err != nil {
return fmt.Errorf("error getting authorization: %s", err)
}
if !auth.CanAuthorizeV2() {
return ErrV2RegistryUnavailable
}
var layersDownloaded bool
if tag == "" {
logrus.Debugf("Pulling tag list from V2 registry for %s", repoInfo.CanonicalName)