浏览代码

Merge pull request #13986 from tg123/master

prompt a cli login if receive 401 from registry v2 auth server
Jessie Frazelle 10 年之前
父节点
当前提交
ff8cef3326
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      api/client/utils.go

+ 1 - 0
api/client/utils.go

@@ -149,6 +149,7 @@ func (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reade
 			// we may need to change the status code.
 			// we may need to change the status code.
 			if strings.Contains(err.Error(), "Authentication is required") ||
 			if strings.Contains(err.Error(), "Authentication is required") ||
 				strings.Contains(err.Error(), "Status 401") ||
 				strings.Contains(err.Error(), "Status 401") ||
+				strings.Contains(err.Error(), "401 Unauthorized") ||
 				strings.Contains(err.Error(), "status code 401") {
 				strings.Contains(err.Error(), "status code 401") {
 				serverResp.statusCode = http.StatusUnauthorized
 				serverResp.statusCode = http.StatusUnauthorized
 			}
 			}