diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-05-20 07:16:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 07:16:35 -0400 |
commit | 916d8231c52eb89fae9982c63a956388fca648c2 (patch) | |
tree | 335652b32332e57e092a1bbf80914517190f136e /pkg/api/handlers/libpod/volumes.go | |
parent | 1916fe22a932183e0847e9f7b087f6ece4d7c48c (diff) | |
parent | 5b79cf15a0226dc3dad5053615ee652823376cd3 (diff) | |
download | podman-916d8231c52eb89fae9982c63a956388fca648c2.tar.gz podman-916d8231c52eb89fae9982c63a956388fca648c2.tar.bz2 podman-916d8231c52eb89fae9982c63a956388fca648c2.zip |
Merge pull request #14297 from jwhonce/wip/swagger
Swagger refactor/cleanup
Diffstat (limited to 'pkg/api/handlers/libpod/volumes.go')
-rw-r--r-- | pkg/api/handlers/libpod/volumes.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/pkg/api/handlers/libpod/volumes.go b/pkg/api/handlers/libpod/volumes.go index e0ea16d82..e792dea35 100644 --- a/pkg/api/handlers/libpod/volumes.go +++ b/pkg/api/handlers/libpod/volumes.go @@ -25,8 +25,7 @@ func CreateVolume(w http.ResponseWriter, r *http.Request) { runtime = r.Context().Value(api.RuntimeKey).(*libpod.Runtime) decoder = r.Context().Value(api.DecoderKey).(*schema.Decoder) ) - query := struct { - }{ + query := struct{}{ // override any golang type defaults } if err := decoder.Decode(&query, r.URL.Query()); err != nil { @@ -86,9 +85,7 @@ func CreateVolume(w http.ResponseWriter, r *http.Request) { } func InspectVolume(w http.ResponseWriter, r *http.Request) { - var ( - runtime = r.Context().Value(api.RuntimeKey).(*libpod.Runtime) - ) + runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) name := utils.GetName(r) vol, err := runtime.GetVolume(name) if err != nil { @@ -107,9 +104,7 @@ func InspectVolume(w http.ResponseWriter, r *http.Request) { } func ListVolumes(w http.ResponseWriter, r *http.Request) { - var ( - runtime = r.Context().Value(api.RuntimeKey).(*libpod.Runtime) - ) + runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) filterMap, err := util.PrepareFilters(r) if err != nil { utils.Error(w, http.StatusInternalServerError, @@ -153,9 +148,7 @@ func PruneVolumes(w http.ResponseWriter, r *http.Request) { } func pruneVolumesHelper(r *http.Request) ([]*reports.PruneReport, error) { - var ( - runtime = r.Context().Value(api.RuntimeKey).(*libpod.Runtime) - ) + runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) filterMap, err := util.PrepareFilters(r) if err != nil { return nil, err |