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 <bbaude@redhat.com>
This commit is contained in:
Brent Baude 2024-09-19 13:42:38 -05:00
parent 45c3dd604e
commit 11ea8396fd
1 changed files with 8 additions and 0 deletions

View File

@ -60,6 +60,13 @@ type CopyOptions struct {
CertDirPath string CertDirPath string
// Force layer compression when copying to a `dir` transport destination. // Force layer compression when copying to a `dir` transport destination.
DirForceCompress bool 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 // Allow contacting registries over HTTP, or HTTPS with failed TLS
// verification. Note that this does not affect other TLS connections. // verification. Note that this does not affect other TLS connections.
InsecureSkipTLSVerify types.OptionalBool InsecureSkipTLSVerify types.OptionalBool
@ -300,6 +307,7 @@ func (r *Runtime) newCopier(options *CopyOptions) (*copier, error) {
c.imageCopyOptions.ProgressInterval = time.Second c.imageCopyOptions.ProgressInterval = time.Second
} }
c.imageCopyOptions.ImageListSelection = options.ImageListSelection
c.imageCopyOptions.ForceCompressionFormat = options.ForceCompressionFormat c.imageCopyOptions.ForceCompressionFormat = options.ForceCompressionFormat
c.imageCopyOptions.ForceManifestMIMEType = options.ManifestMIMEType c.imageCopyOptions.ForceManifestMIMEType = options.ManifestMIMEType
c.imageCopyOptions.SourceCtx = c.systemContext c.imageCopyOptions.SourceCtx = c.systemContext