loosen http status code checks

This commit is contained in:
Michael Yang
2023-08-26 21:55:21 -07:00
parent 865fceb73c
commit 246dc65417
5 changed files with 16 additions and 17 deletions

View File

@@ -109,7 +109,7 @@ func getAuthToken(ctx context.Context, redirData AuthRedirect, regOpts *Registry
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
if resp.StatusCode >= http.StatusBadRequest {
body, _ := io.ReadAll(resp.Body)
return "", fmt.Errorf("on pull registry responded with code %d: %s", resp.StatusCode, body)
}