summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/images.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2020-01-19 10:39:50 -0600
committerBrent Baude <bbaude@redhat.com>2020-01-21 12:50:41 -0600
commit78e4e83e92b2c17ed59564e8f504f17008c7d269 (patch)
tree6090f92ae5a6f5aebf0711d05e9ad69bb2b39aeb /pkg/api/handlers/images.go
parentfb2bd26f7331ee3a1ca9690d9c2960ccadebc68f (diff)
downloadpodman-78e4e83e92b2c17ed59564e8f504f17008c7d269.tar.gz
podman-78e4e83e92b2c17ed59564e8f504f17008c7d269.tar.bz2
podman-78e4e83e92b2c17ed59564e8f504f17008c7d269.zip
[CI:DOCS]First pass at review comments
Tackling the first comments in the review pass. More to come. Signed-off-by: baude <bbaude@redhat.com> Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/api/handlers/images.go')
-rw-r--r--pkg/api/handlers/images.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/api/handlers/images.go b/pkg/api/handlers/images.go
index d4cddbfb2..b4acdc312 100644
--- a/pkg/api/handlers/images.go
+++ b/pkg/api/handlers/images.go
@@ -74,8 +74,25 @@ func TagImage(w http.ResponseWriter, r *http.Request) {
}
func RemoveImage(w http.ResponseWriter, r *http.Request) {
+ decoder := r.Context().Value("decoder").(*schema.Decoder)
runtime := r.Context().Value("runtime").(*libpod.Runtime)
+ query := struct {
+ noPrune bool
+ }{
+ // This is where you can override the golang default value for one of fields
+ }
+
+ if err := decoder.Decode(&query, r.URL.Query()); err != nil {
+ utils.Error(w, "Something went wrong.", http.StatusBadRequest, errors.Wrapf(err, "Failed to parse parameters for %s", r.URL.String()))
+ return
+ }
+ muxVars := mux.Vars(r)
+ if _, found := muxVars["noprune"]; found {
+ if query.noPrune {
+ utils.UnSupportedParameter("noprune")
+ }
+ }
name := mux.Vars(r)["name"]
newImage, err := runtime.ImageRuntime().NewFromLocal(name)
if err != nil {