summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-20 17:29:31 -0500
committerGitHub <noreply@github.com>2022-01-20 17:29:31 -0500
commit993c072029fb2c3938d3685ca7e38b5eab29c400 (patch)
treef694f5295873b3a6cf2cfd9531a985fc5239a248 /pkg
parentca62a39985bf9d1835e8a9718d7f6c02f1f0607c (diff)
parent1c0fdba4f2cfbabadcbd16933882dbb2fb2e77f8 (diff)
downloadpodman-993c072029fb2c3938d3685ca7e38b5eab29c400.tar.gz
podman-993c072029fb2c3938d3685ca7e38b5eab29c400.tar.bz2
podman-993c072029fb2c3938d3685ca7e38b5eab29c400.zip
Merge pull request #12942 from flouthoc/compat-load-tar-with-multiple-images
compat: `images/load` must be able to load tar with multiple images
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/images.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go
index 23a9b12a3..401a7ec1b 100644
--- a/pkg/api/handlers/compat/images.go
+++ b/pkg/api/handlers/compat/images.go
@@ -503,15 +503,15 @@ 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
}
utils.WriteResponse(w, http.StatusOK, struct {
Stream string `json:"stream"`
}{
- Stream: fmt.Sprintf("Loaded image: %s\n", loadReport.Names[0]),
+ Stream: fmt.Sprintf("Loaded image: %s", strings.Join(loadReport.Names, ",")),
})
}