summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorAditya R <arajan@redhat.com>2022-01-20 17:40:27 +0530
committerAditya R <arajan@redhat.com>2022-01-21 00:23:54 +0530
commit9df31cfb7784b158308abc5eabb7ff5176011518 (patch)
treec0d33ca964b68b124c0a8880e32b8446fa115f39 /pkg/api
parent1d6e154a73505cd0366cdeec7cc8582dd3ac2191 (diff)
downloadpodman-9df31cfb7784b158308abc5eabb7ff5176011518.tar.gz
podman-9df31cfb7784b158308abc5eabb7ff5176011518.tar.bz2
podman-9df31cfb7784b158308abc5eabb7ff5176011518.zip
compat: images/load must be able to load tar with multiple images
`http:/host:port/images/load` fails to accept tar with more than one images however manual load works as expected. Remove explicit check for `1` image and only fail if result set has value less than `1`. Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/compat/images.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go
index 23a9b12a3..4abd510bf 100644
--- a/pkg/api/handlers/compat/images.go
+++ b/pkg/api/handlers/compat/images.go
@@ -503,8 +503,8 @@ func LoadImages(w http.ResponseWriter, r *http.Request) {
return
}
- if len(loadReport.Names) != 1 {
- utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Errorf("%d instead of 1 were loaded", len(loadReport.Names)))
+ if len(loadReport.Names) < 1 {
+ utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Errorf("one or more images are required"))
return
}