From 0062a0298811904680919762e934b7e61184460f Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Tue, 28 Mar 2017 14:43:33 +0000 Subject: [PATCH] docker/image_dest: ask for pull action in token scope After PR #202, PutBlob() now goes through an initial HasBlob() which may require authentication in order to perform the check; in such case a push-only scoped token will fail with: ``` service="registry.docker.io",scope="repository::pull",error="insufficient_scope" ``` This fixes the above case by changing the scope of the token requested for uploads, allowing pull+push. Signed-off-by: Luca Bruno --- docker/docker_image_dest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker_image_dest.go b/docker/docker_image_dest.go index 2b99bb7efb..f89a5364bc 100644 --- a/docker/docker_image_dest.go +++ b/docker/docker_image_dest.go @@ -42,7 +42,7 @@ type dockerImageDestination struct { // newImageDestination creates a new ImageDestination for the specified image reference. func newImageDestination(ctx *types.SystemContext, ref dockerReference) (types.ImageDestination, error) { - c, err := newDockerClient(ctx, ref, true, "push") + c, err := newDockerClient(ctx, ref, true, "pull,push") if err != nil { return nil, err }