summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-30 17:10:20 -0800
committerGitHub <noreply@github.com>2020-01-30 17:10:20 -0800
commitba1d1304a67bb1a67482998763f3663fa43edd79 (patch)
treece272d32d985ac9686798f55e282e8316268ae40 /cmd
parent4f96b17ef58f83e58af2a8016e1acc7f68a959c7 (diff)
parent9bbf08de254dbaad9f12b6ad8a72650994c04fd2 (diff)
downloadpodman-ba1d1304a67bb1a67482998763f3663fa43edd79.tar.gz
podman-ba1d1304a67bb1a67482998763f3663fa43edd79.tar.bz2
podman-ba1d1304a67bb1a67482998763f3663fa43edd79.zip
Merge pull request #5028 from baude/commitimage
make image reference for commit optional
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/commit.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/podman/commit.go b/cmd/podman/commit.go
index e98b71514..604e8d31c 100644
--- a/cmd/podman/commit.go
+++ b/cmd/podman/commit.go
@@ -56,12 +56,15 @@ func commitCmd(c *cliconfig.CommitValues) error {
defer runtime.DeferredShutdown(false)
args := c.InputArgs
- if len(args) != 2 {
- return errors.Errorf("you must provide a container name or ID and a target image name")
+ if len(args) < 1 {
+ return errors.Errorf("you must provide a container name or ID and optionally a target image name")
}
container := args[0]
- reference := args[1]
+ reference := ""
+ if len(args) > 1 {
+ reference = args[1]
+ }
if c.Flag("change").Changed {
for _, change := range c.Change {
splitChange := strings.Split(strings.ToUpper(change), "=")