From b1c6279d5291de744bbcc1df46805c837199665b Mon Sep 17 00:00:00 2001 From: tgic Date: Wed, 17 Jun 2015 19:28:13 +0800 Subject: [PATCH] prompt a cli login if receive 401 from registry v2 auth server Signed-off-by: tgic Upstream-commit: fe7b3658bd828bc034037d9ae813b4addf7dfdc3 Component: engine --- components/engine/api/client/utils.go | 1 + 1 file changed, 1 insertion(+) diff --git a/components/engine/api/client/utils.go b/components/engine/api/client/utils.go index b9d8f27c44..960bc20d54 100644 --- a/components/engine/api/client/utils.go +++ b/components/engine/api/client/utils.go @@ -132,6 +132,7 @@ func (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reade // we may need to change the status code. if strings.Contains(err.Error(), "Authentication is required") || strings.Contains(err.Error(), "Status 401") || + strings.Contains(err.Error(), "401 Unauthorized") || strings.Contains(err.Error(), "status code 401") { statusCode = http.StatusUnauthorized }