diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-22 11:00:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 11:00:09 -0400 |
commit | 513c2610f37fa530b951a9a0105f49dfd346c091 (patch) | |
tree | a3e889e5825ea067b93991770bdf1ebba5e8be27 /libpod/image | |
parent | 5d70f46bd3f90739bf1ae3eba473523200669025 (diff) | |
parent | b898f914a3a9b8cad5519ace0167d738e2f85186 (diff) | |
download | podman-513c2610f37fa530b951a9a0105f49dfd346c091.tar.gz podman-513c2610f37fa530b951a9a0105f49dfd346c091.tar.bz2 podman-513c2610f37fa530b951a9a0105f49dfd346c091.zip |
Merge pull request #7956 from QiWang19/save-rm-sig
Allow save image remove-signatures
Diffstat (limited to 'libpod/image')
-rw-r--r-- | libpod/image/image.go | 8 |
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) |