Skip to content

Commit

Permalink
podman-save: Add signature-policy flag
Browse files Browse the repository at this point in the history
Allow overwrite of the signature-policy file
similiar to other cli commands: podman load, podman pull, ...

Closes: containers#15869
Signed-off-by: 馃槑Mostafa Emami <mustafaemami@gmail.com>
  • Loading branch information
idleroamer committed Sep 20, 2022
1 parent 30231d0 commit 49de62f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/podman/images/save.go
Expand Up @@ -96,6 +96,7 @@ func saveFlags(cmd *cobra.Command) {

flags.BoolVarP(&saveOpts.Quiet, "quiet", "q", false, "Suppress the output")
flags.BoolVarP(&saveOpts.MultiImageArchive, "multi-image-archive", "m", containerConfig.Engine.MultiImageArchive, "Interpret additional arguments as images not tags and create a multi-image-archive (only for docker-archive)")
flags.StringVar(&saveOpts.SignaturePolicy, "signature-policy", "", "Pathname of signature policy file")
}

func save(cmd *cobra.Command, args []string) (finalErr error) {
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/entities/images.go
Expand Up @@ -336,6 +336,7 @@ type ImageSaveOptions struct {
Output string
// Quiet - suppress output when copying images
Quiet bool
SignaturePolicy string
}

// ImageScpOptions provide options for securely copying images to and from a remote host
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/infra/abi/images.go
Expand Up @@ -406,6 +406,7 @@ func (ir *ImageEngine) Save(ctx context.Context, nameOrID string, tags []string,
saveOptions := &libimage.SaveOptions{}
saveOptions.DirForceCompress = options.Compress
saveOptions.OciAcceptUncompressedLayers = options.OciAcceptUncompressedLayers
saveOptions.SignaturePolicyPath = options.SignaturePolicy

// Force signature removal to preserve backwards compat.
// See https://github.com/containers/podman/pull/11669#issuecomment-925250264
Expand Down

0 comments on commit 49de62f

Please sign in to comment.