summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTomSweeneyRedHat <tsweeney@redhat.com>2019-08-20 20:04:21 -0400
committerTomSweeneyRedHat <tsweeney@redhat.com>2019-08-21 10:11:52 -0400
commit9ced2488c953a11007e836403498f7c0892467f5 (patch)
treefa4d869959ad81a13b53cde08d812e3b77fa89e7 /cmd
parent1ad8fe52412c8cef215e5a5af312e5db680c3916 (diff)
downloadpodman-9ced2488c953a11007e836403498f7c0892467f5.tar.gz
podman-9ced2488c953a11007e836403498f7c0892467f5.tar.bz2
podman-9ced2488c953a11007e836403498f7c0892467f5.zip
Add --digestfile option to push
Add the digestfile option to the push command so the digest can be stored away in a file when requested by the user. Also have added a debug statement to show the completion of the push. Emulates Buildah's https://github.com/containers/buildah/pull/1799/files Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/cliconfig/config.go1
-rw-r--r--cmd/podman/push.go3
2 files changed, 3 insertions, 1 deletions
diff --git a/cmd/podman/cliconfig/config.go b/cmd/podman/cliconfig/config.go
index e7ad921da..8075baf34 100644
--- a/cmd/podman/cliconfig/config.go
+++ b/cmd/podman/cliconfig/config.go
@@ -423,6 +423,7 @@ type PushValues struct {
CertDir string
Compress bool
Creds string
+ Digestfile string
Format string
Quiet bool
RemoveSignatures bool
diff --git a/cmd/podman/push.go b/cmd/podman/push.go
index 43df8c2de..13ebe8a1f 100644
--- a/cmd/podman/push.go
+++ b/cmd/podman/push.go
@@ -51,6 +51,7 @@ func init() {
pushCommand.SetUsageTemplate(UsageTemplate())
flags := pushCommand.Flags()
flags.StringVar(&pushCommand.Creds, "creds", "", "`Credentials` (USERNAME:PASSWORD) to use for authenticating to a registry")
+ flags.StringVar(&pushCommand.Digestfile, "digestfile", "", "After copying the image, write the digest of the resulting image to the file")
flags.StringVarP(&pushCommand.Format, "format", "f", "", "Manifest type (oci, v2s1, or v2s2) to use when pushing an image using the 'dir:' transport (default is manifest type of source)")
flags.BoolVarP(&pushCommand.Quiet, "quiet", "q", false, "Don't output progress information when pushing images")
flags.BoolVar(&pushCommand.RemoveSignatures, "remove-signatures", false, "Discard any pre-existing signatures in the image")
@@ -143,5 +144,5 @@ func pushCmd(c *cliconfig.PushValues) error {
SignBy: signBy,
}
- return runtime.Push(getContext(), srcName, destName, manifestType, c.Authfile, c.SignaturePolicy, writer, c.Compress, so, &dockerRegistryOptions, nil)
+ return runtime.Push(getContext(), srcName, destName, manifestType, c.Authfile, c.String("digestfile"), c.SignaturePolicy, writer, c.Compress, so, &dockerRegistryOptions, nil)
}