From a2e8ab9ff78047476e3e4e1cedfa56cc08bd829f Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 19 Nov 2018 17:33:59 -0800 Subject: [PATCH] remotes: avoid panic with default resolver conf Signed-off-by: Tonis Tiigi --- remotes/docker/authorizer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remotes/docker/authorizer.go b/remotes/docker/authorizer.go index 2d88c9f17..e17628750 100644 --- a/remotes/docker/authorizer.go +++ b/remotes/docker/authorizer.go @@ -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 {