From 11ea8396fd146be4c69e548397f7ff1ea56bc797 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Thu, 19 Sep 2024 13:42:38 -0500 Subject: [PATCH] Add ImageListSelection to copier options For artifact support, the copier needs to get all tags; as such, we need to pass in the correct value for ImageListSelection. Signed-off-by: Brent Baude --- common/libimage/copier.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/libimage/copier.go b/common/libimage/copier.go index 1f4f925fe5..3a94dc4fe6 100644 --- a/common/libimage/copier.go +++ b/common/libimage/copier.go @@ -60,6 +60,13 @@ type CopyOptions struct { CertDirPath string // Force layer compression when copying to a `dir` transport destination. DirForceCompress bool + + // ImageListSelection is one of CopySystemImage, CopyAllImages, or + // CopySpecificImages, to control whether, when the source reference is a list, + // copy.Image() copies only an image which matches the current runtime + // environment, or all images which match the supplied reference, or only + // specific images from the source reference. + ImageListSelection copy.ImageListSelection // Allow contacting registries over HTTP, or HTTPS with failed TLS // verification. Note that this does not affect other TLS connections. InsecureSkipTLSVerify types.OptionalBool @@ -300,6 +307,7 @@ func (r *Runtime) newCopier(options *CopyOptions) (*copier, error) { c.imageCopyOptions.ProgressInterval = time.Second } + c.imageCopyOptions.ImageListSelection = options.ImageListSelection c.imageCopyOptions.ForceCompressionFormat = options.ForceCompressionFormat c.imageCopyOptions.ForceManifestMIMEType = options.ManifestMIMEType c.imageCopyOptions.SourceCtx = c.systemContext