[transfer] update export to use image store references

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2023-02-28 22:15:44 -08:00
parent e2283edefb
commit 13bf5565eb
8 changed files with 274 additions and 64 deletions

View File

@@ -89,6 +89,18 @@ func WithImage(is images.Store, name string) ExportOpt {
}
}
// WithImages adds multiples images to the exported archive.
func WithImages(imgs []images.Image) ExportOpt {
return func(ctx context.Context, o *exportOptions) error {
for _, img := range imgs {
img.Target.Annotations = addNameAnnotation(img.Name, img.Target.Annotations)
o.manifests = append(o.manifests, img.Target)
}
return nil
}
}
// WithManifest adds a manifest to the exported archive.
// When names are given they will be set on the manifest in the
// exported archive, creating an index record for each name.