Merge pull request #2812 from tonistiigi/credential-nil-check

remotes: avoid panic with default resolver conf
This commit is contained in:
Michael Crosby 2018-11-20 10:19:38 -05:00 committed by GitHub
commit c0a3b6e823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ func (a *dockerAuthorizer) AddResponses(ctx context.Context, responses []*http.R
// TODO(dmcg): Store challenge, not token
// Move token fetching to authorize
return a.setTokenAuth(ctx, host, c.parameters)
} else if c.scheme == basicAuth {
} else if c.scheme == basicAuth && a.credentials != nil {
// TODO: Resolve credentials on authorize
username, secret, err := a.credentials(host)
if err != nil {