Skip to content

Commit

Permalink
podman push without destination image
Browse files Browse the repository at this point in the history
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
  • Loading branch information
baude authored and rh-atomic-bot committed Apr 20, 2018
1 parent 7580b1c commit 3c5c0f5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions cmd/podman/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3c5c0f5

Please sign in to comment.