| ... | ... |
@@ -86,7 +86,7 @@ func (s *TagStore) CmdPull(job *engine.Job) engine.Status {
|
| 86 | 86 |
log.Errorf("Error logging event 'pull' for %s: %s", logName, err)
|
| 87 | 87 |
} |
| 88 | 88 |
return engine.StatusOK |
| 89 |
- } else if err != registry.ErrDoesNotExist {
|
|
| 89 |
+ } else if err != registry.ErrDoesNotExist && err != ErrV2RegistryUnavailable {
|
|
| 90 | 90 |
log.Errorf("Error from V2 registry: %s", err)
|
| 91 | 91 |
} |
| 92 | 92 |
|
| ... | ... |
@@ -374,6 +374,10 @@ type downloadInfo struct {
|
| 374 | 374 |
func (s *TagStore) pullV2Repository(eng *engine.Engine, r *registry.Session, out io.Writer, repoInfo *registry.RepositoryInfo, tag string, sf *utils.StreamFormatter, parallel bool) error {
|
| 375 | 375 |
endpoint, err := r.V2RegistryEndpoint(repoInfo.Index) |
| 376 | 376 |
if err != nil {
|
| 377 |
+ if repoInfo.Index.Official {
|
|
| 378 |
+ log.Debugf("Unable to pull from V2 registry, falling back to v1: %s", err)
|
|
| 379 |
+ return ErrV2RegistryUnavailable |
|
| 380 |
+ } |
|
| 377 | 381 |
return fmt.Errorf("error getting registry endpoint: %s", err)
|
| 378 | 382 |
} |
| 379 | 383 |
auth, err := r.GetV2Authorization(endpoint, repoInfo.RemoteName, true) |
| ... | ... |
@@ -284,7 +284,7 @@ func (s *TagStore) pushV2Repository(r *registry.Session, eng *engine.Engine, out |
| 284 | 284 |
endpoint, err := r.V2RegistryEndpoint(repoInfo.Index) |
| 285 | 285 |
if err != nil {
|
| 286 | 286 |
if repoInfo.Index.Official {
|
| 287 |
- log.Infof("Unable to push to V2 registry, falling back to v1: %s", err)
|
|
| 287 |
+ log.Debugf("Unable to push to V2 registry, falling back to v1: %s", err)
|
|
| 288 | 288 |
return ErrV2RegistryUnavailable |
| 289 | 289 |
} |
| 290 | 290 |
return fmt.Errorf("error getting registry endpoint: %s", err)
|