summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-07-30 14:00:44 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-07-30 17:42:15 -0400
commit0785d6af157f815b93b2c7b105dbece2dbb7fefa (patch)
tree94c3fc2732b16624edbec6156ef4384a4a305d82 /pkg/api
parent4132b71478c486b3f4eff6a344ee1b2defbab86f (diff)
downloadpodman-0785d6af157f815b93b2c7b105dbece2dbb7fefa.tar.gz
podman-0785d6af157f815b93b2c7b105dbece2dbb7fefa.tar.bz2
podman-0785d6af157f815b93b2c7b105dbece2dbb7fefa.zip
Handle single character images
Currently you can only specify multiple character for image names when executing podman-remote commit podman-remote commit a b Will complete, but will save the image without a name. podman-remote commit a bb Works. This PR fixes and now returns an error if the user doees not specify an image name to commit to. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/libpod/images.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go
index 3421f0836..d47f27134 100644
--- a/pkg/api/handlers/libpod/images.go
+++ b/pkg/api/handlers/libpod/images.go
@@ -594,11 +594,9 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
return
}
- // I know mitr hates this ... but doing for now
- if len(query.Repo) > 1 {
+ if len(query.Repo) > 0 {
destImage = fmt.Sprintf("%s:%s", query.Repo, tag)
}
-
commitImage, err := ctr.Commit(r.Context(), destImage, options)
if err != nil && !strings.Contains(err.Error(), "is not running") {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrapf(err, "CommitFailure"))