Browse code

Don't retry push on an unknown repository

If the remote registry responds with a NAME_UNKNOWN error, treat this as
a fatal error and don't retry the push.

Tested against an ECR registry.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit a12ab28e0afb8dd0a05187989dd95c9b9ca3fd68)
Signed-off-by: Tibor Vass <tibor@docker.com>

Aaron Lehmann authored on 2016/07/12 09:06:23
Showing 1 changed files
... ...
@@ -89,7 +89,7 @@ func retryOnError(err error) error {
89 89
 		}
90 90
 	case errcode.Error:
91 91
 		switch v.Code {
92
-		case errcode.ErrorCodeUnauthorized, errcode.ErrorCodeUnsupported, errcode.ErrorCodeDenied, errcode.ErrorCodeTooManyRequests:
92
+		case errcode.ErrorCodeUnauthorized, errcode.ErrorCodeUnsupported, errcode.ErrorCodeDenied, errcode.ErrorCodeTooManyRequests, v2.ErrorCodeNameUnknown:
93 93
 			return xfer.DoNotRetry{Err: err}
94 94
 		}
95 95
 	case *url.Error: