From 1b79c70b90a87dc68e4b38c4c8a34c7bc29972c4 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Tue, 22 Oct 2019 18:21:52 -0400 Subject: [PATCH] copy.Image(): select the CopySystemImage image using the source context Go back to selecting which image instance we copy in CopySystemImage mode using the source context rather than the destination context. Signed-off-by: Nalin Dahyabhai --- copy/copy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copy/copy.go b/copy/copy.go index 7e3561023..a2941e2a1 100644 --- a/copy/copy.go +++ b/copy/copy.go @@ -269,7 +269,7 @@ func Image(ctx context.Context, policyContext *signature.PolicyContext, destRef, if err != nil { return nil, errors.Wrapf(err, "Error parsing primary manifest as list for %s", transports.ImageName(srcRef)) } - instanceDigest, err := manifestList.ChooseInstance(options.DestinationCtx) // try to pick one that matches options.DestinationCtx + instanceDigest, err := manifestList.ChooseInstance(options.SourceCtx) // try to pick one that matches options.SourceCtx if err != nil { return nil, errors.Wrapf(err, "Error choosing an image from manifest list %s", transports.ImageName(srcRef)) }