mirror of
https://github.com/containers/skopeo.git
synced 2025-08-24 17:18:56 +00:00
Merge pull request #599 from rhatdan/quiet
Add --quiet option to skopeo copy
This commit is contained in:
commit
c2597aab22
@ -23,6 +23,8 @@ type copyOptions struct {
|
|||||||
removeSignatures bool // Do not copy signatures from the source image
|
removeSignatures bool // Do not copy signatures from the source image
|
||||||
signByFingerprint string // Sign the image using a GPG key with the specified fingerprint
|
signByFingerprint string // Sign the image using a GPG key with the specified fingerprint
|
||||||
format optionalString // Force conversion of the image to a specified format
|
format optionalString // Force conversion of the image to a specified format
|
||||||
|
quiet bool // Suppress output information when copying images
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyCmd(global *globalOptions) cli.Command {
|
func copyCmd(global *globalOptions) cli.Command {
|
||||||
@ -55,6 +57,11 @@ func copyCmd(global *globalOptions) cli.Command {
|
|||||||
Usage: "additional tags (supports docker-archive)",
|
Usage: "additional tags (supports docker-archive)",
|
||||||
Value: &opts.additionalTags, // Surprisingly StringSliceFlag does not support Destination:, but modifies Value: in place.
|
Value: &opts.additionalTags, // Surprisingly StringSliceFlag does not support Destination:, but modifies Value: in place.
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "quiet, q",
|
||||||
|
Usage: "Suppress output information when copying images",
|
||||||
|
Destination: &opts.quiet,
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "remove-signatures",
|
Name: "remove-signatures",
|
||||||
Usage: "Do not copy signatures from SOURCE-IMAGE",
|
Usage: "Do not copy signatures from SOURCE-IMAGE",
|
||||||
@ -132,6 +139,9 @@ func (opts *copyOptions) run(args []string, stdout io.Writer) error {
|
|||||||
ctx, cancel := opts.global.commandTimeoutContext()
|
ctx, cancel := opts.global.commandTimeoutContext()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
if opts.quiet {
|
||||||
|
stdout = nil
|
||||||
|
}
|
||||||
_, err = copy.Image(ctx, policyContext, destRef, srcRef, ©.Options{
|
_, err = copy.Image(ctx, policyContext, destRef, srcRef, ©.Options{
|
||||||
RemoveSignatures: opts.removeSignatures,
|
RemoveSignatures: opts.removeSignatures,
|
||||||
SignBy: opts.signByFingerprint,
|
SignBy: opts.signByFingerprint,
|
||||||
|
@ -85,6 +85,7 @@ Uses the system's trust policy to validate images, rejects images not trusted by
|
|||||||
|
|
||||||
**--format, -f** _manifest-type_ Manifest type (oci, v2s1, or v2s2) to use when saving image to directory using the 'dir:' transport (default is manifest type of source)
|
**--format, -f** _manifest-type_ Manifest type (oci, v2s1, or v2s2) to use when saving image to directory using the 'dir:' transport (default is manifest type of source)
|
||||||
|
|
||||||
|
**--quiet, -q** suppress output information when copying images
|
||||||
**--remove-signatures** do not copy signatures, if any, from _source-image_. Necessary when copying a signed image to a destination which does not support signatures.
|
**--remove-signatures** do not copy signatures, if any, from _source-image_. Necessary when copying a signed image to a destination which does not support signatures.
|
||||||
|
|
||||||
**--sign-by=**_key-id_ add a signature using that key ID for an image name corresponding to _destination-image_
|
**--sign-by=**_key-id_ add a signature using that key ID for an image name corresponding to _destination-image_
|
||||||
|
Loading…
Reference in New Issue
Block a user