summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-04-19 08:58:20 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-20 14:55:47 +0000
commit3c5c0f5b69f8167c68bba88403882a13302c829e (patch)
treeae0f270c9492a7dcf2b1d2452d81f3e9f53ebf5b /cmd/podman
parent7580b1c204c97235a3351f51a7901dda3e846623 (diff)
downloadpodman-3c5c0f5b69f8167c68bba88403882a13302c829e.tar.gz
podman-3c5c0f5b69f8167c68bba88403882a13302c829e.tar.bz2
podman-3c5c0f5b69f8167c68bba88403882a13302c829e.zip
podman push without destination image
the destination image for podman push should be optional (if the destination has already been tagged in). the man page for podman push describes that it should work this way. Resolves: #645 Signed-off-by: baude <bbaude@redhat.com> Closes: #646 Approved by: mheon
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/push.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/cmd/podman/push.go b/cmd/podman/push.go
index d80af2ef3..369d4d4f2 100644
--- a/cmd/podman/push.go
+++ b/cmd/podman/push.go
@@ -76,17 +76,25 @@ var (
)
func pushCmd(c *cli.Context) error {
- var registryCreds *types.DockerAuthConfig
+ var (
+ registryCreds *types.DockerAuthConfig
+ destName string
+ )
args := c.Args()
- if len(args) < 2 {
- return errors.New("podman push requires exactly 2 arguments")
+ srcName := args[0]
+ if len(args) == 0 || len(args) > 2 {
+ return errors.New("podman push requires at least one image name, and optionally a second to specify a different destination name")
+ }
+ switch len(args) {
+ case 1:
+ destName = args[0]
+ case 2:
+ destName = args[1]
}
if err := validateFlags(c, pushFlags); err != nil {
return err
}
- srcName := args[0]
- destName := args[1]
// --compress and --format can only be used for the "dir" transport
splitArg := strings.SplitN(destName, ":", 2)