summaryrefslogtreecommitdiff
path: root/libpod/image
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-10-21 09:51:35 -0400
committerQi Wang <qiwan@redhat.com>2020-10-21 10:00:08 -0400
commitb898f914a3a9b8cad5519ace0167d738e2f85186 (patch)
tree19c8a7dcc25b5375c4e0fd8010f62ee34d743cd9 /libpod/image
parent94873a237ab52db27916b8954e489fe780eea069 (diff)
downloadpodman-b898f914a3a9b8cad5519ace0167d738e2f85186.tar.gz
podman-b898f914a3a9b8cad5519ace0167d738e2f85186.tar.bz2
podman-b898f914a3a9b8cad5519ace0167d738e2f85186.zip
save image remove signatures
remove signatures to podman save since the image formats do not support signatures Close: #7659 Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'libpod/image')
-rw-r--r--libpod/image/image.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index 0900944eb..62c6a2088 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -177,7 +177,7 @@ func (ir *Runtime) New(ctx context.Context, name, signaturePolicyPath, authfile
// SaveImages stores one more images in a multi-image archive.
// Note that only `docker-archive` supports storing multiple
// image.
-func (ir *Runtime) SaveImages(ctx context.Context, namesOrIDs []string, format string, outputFile string, quiet bool) (finalErr error) {
+func (ir *Runtime) SaveImages(ctx context.Context, namesOrIDs []string, format string, outputFile string, quiet, removeSignatures bool) (finalErr error) {
if format != DockerArchive {
return errors.Errorf("multi-image archives are only supported in in the %q format", DockerArchive)
}
@@ -264,7 +264,7 @@ func (ir *Runtime) SaveImages(ctx context.Context, namesOrIDs []string, format s
}
img := imageMap[id]
- copyOptions := getCopyOptions(sys, writer, nil, nil, SigningOptions{}, "", img.tags)
+ copyOptions := getCopyOptions(sys, writer, nil, nil, SigningOptions{RemoveSignatures: removeSignatures}, "", img.tags)
copyOptions.DestinationCtx.SystemRegistriesConfPath = registries.SystemRegistriesConfPath()
// For copying, we need a source reference that we can create
@@ -1584,7 +1584,7 @@ func (i *Image) Comment(ctx context.Context, manifestType string) (string, error
}
// Save writes a container image to the filesystem
-func (i *Image) Save(ctx context.Context, source, format, output string, moreTags []string, quiet, compress bool) error {
+func (i *Image) Save(ctx context.Context, source, format, output string, moreTags []string, quiet, compress, removeSignatures bool) error {
var (
writer io.Writer
destRef types.ImageReference
@@ -1636,7 +1636,7 @@ func (i *Image) Save(ctx context.Context, source, format, output string, moreTag
return err
}
}
- if err := i.PushImageToReference(ctx, destRef, manifestType, "", "", "", writer, compress, SigningOptions{}, &DockerRegistryOptions{}, additionaltags); err != nil {
+ if err := i.PushImageToReference(ctx, destRef, manifestType, "", "", "", writer, compress, SigningOptions{RemoveSignatures: removeSignatures}, &DockerRegistryOptions{}, additionaltags); err != nil {
return errors.Wrapf(err, "unable to save %q", source)
}
i.newImageEvent(events.Save)