From 067fff8b03dae2be7e1c98b6d2974c046702e3f7 Mon Sep 17 00:00:00 2001 From: Riyaz Faizullabhoy Date: Fri, 6 Oct 2017 14:46:17 -0700 Subject: [PATCH] trust: update references when pulling Signed-off-by: Riyaz Faizullabhoy --- cli/command/image/pull.go | 4 ++++ cli/command/image/trust.go | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cli/command/image/pull.go b/cli/command/image/pull.go index 0cf3df609d..9d77e04696 100644 --- a/cli/command/image/pull.go +++ b/cli/command/image/pull.go @@ -54,6 +54,10 @@ func runPull(cli command.Cli, opts pullOptions) error { if !opts.all && reference.IsNameOnly(distributionRef) { distributionRef = reference.TagNameOnly(distributionRef) + imgRefAndAuth, err = trust.GetImageReferencesAndAuth(ctx, AuthResolver(cli), distributionRef.String()) + if err != nil { + return err + } if tagged, ok := distributionRef.(reference.Tagged); ok { fmt.Fprintf(cli.Out(), "Using default tag: %s\n", tagged.Tag()) } diff --git a/cli/command/image/trust.go b/cli/command/image/trust.go index f2847e954b..85f816e219 100644 --- a/cli/command/image/trust.go +++ b/cli/command/image/trust.go @@ -200,7 +200,11 @@ func trustedPull(ctx context.Context, cli command.Cli, imgRefAndAuth trust.Image if err != nil { return err } - if err := imagePullPrivileged(ctx, cli, imgRefAndAuth, false); err != nil { + updatedImgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, AuthResolver(cli), trustedRef.String()) + if err != nil { + return err + } + if err := imagePullPrivileged(ctx, cli, updatedImgRefAndAuth, false); err != nil { return err }