diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-12 02:07:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-12 02:07:36 -0400 |
commit | f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7 (patch) | |
tree | 215fcf8cac010819b632cc4c564025413b93728c /pkg/api/handlers/compat/containers_prune.go | |
parent | 72662f790bad0a3dc26a6a1498b6daa936702bb6 (diff) | |
parent | deaf9692432bb6a9353fe56cecb6cddf0401a78c (diff) | |
download | podman-f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7.tar.gz podman-f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7.tar.bz2 podman-f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7.zip |
Merge pull request #11517 from jwhonce/issues/10053
Refactor API server emphasis on logging
Diffstat (limited to 'pkg/api/handlers/compat/containers_prune.go')
-rw-r--r-- | pkg/api/handlers/compat/containers_prune.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/api/handlers/compat/containers_prune.go b/pkg/api/handlers/compat/containers_prune.go index 61ea7a89e..9fa8bc9f4 100644 --- a/pkg/api/handlers/compat/containers_prune.go +++ b/pkg/api/handlers/compat/containers_prune.go @@ -7,6 +7,7 @@ import ( "github.com/containers/podman/v3/libpod" "github.com/containers/podman/v3/pkg/api/handlers" "github.com/containers/podman/v3/pkg/api/handlers/utils" + api "github.com/containers/podman/v3/pkg/api/types" "github.com/containers/podman/v3/pkg/domain/entities/reports" "github.com/containers/podman/v3/pkg/domain/filters" "github.com/containers/podman/v3/pkg/util" @@ -14,7 +15,7 @@ import ( ) func PruneContainers(w http.ResponseWriter, r *http.Request) { - runtime := r.Context().Value("runtime").(*libpod.Runtime) + runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) filtersMap, err := util.PrepareFilters(r) if err != nil { utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrapf(err, "failed to parse parameters for %s", r.URL.String())) @@ -65,7 +66,7 @@ func PruneContainers(w http.ResponseWriter, r *http.Request) { } func PruneContainersHelper(r *http.Request, filterFuncs []libpod.ContainerFilter) ([]*reports.PruneReport, error) { - runtime := r.Context().Value("runtime").(*libpod.Runtime) + runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) report, err := runtime.PruneContainers(filterFuncs) if err != nil { |