diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-15 15:00:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 15:00:13 -0700 |
commit | c7d17613ec7635413c035e0ed0b8700c56430303 (patch) | |
tree | 2eba4ffc3a0e42b15f28f1e98a12a33c14a224f2 /pkg/domain | |
parent | 0f7162d791076e736a7cee3a45051925fa4d0589 (diff) | |
parent | 30d2964ff83387e3c3fa7447776c57f4342707e6 (diff) | |
download | podman-c7d17613ec7635413c035e0ed0b8700c56430303.tar.gz podman-c7d17613ec7635413c035e0ed0b8700c56430303.tar.bz2 podman-c7d17613ec7635413c035e0ed0b8700c56430303.zip |
Merge pull request #5827 from baude/v2bloat
v2 bloat pruning phase 2
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/entities/container_ps.go | 4 | ||||
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/pkg/domain/entities/container_ps.go b/pkg/domain/entities/container_ps.go index ceafecebc..33f5d0500 100644 --- a/pkg/domain/entities/container_ps.go +++ b/pkg/domain/entities/container_ps.go @@ -4,8 +4,8 @@ import ( "sort" "strings" - "github.com/containers/libpod/cmd/podman/shared" "github.com/containers/libpod/libpod" + "github.com/containers/libpod/pkg/ps/define" "github.com/cri-o/ocicni/pkg/ocicni" "github.com/pkg/errors" ) @@ -48,7 +48,7 @@ type ListContainer struct { // Port mappings Ports []ocicni.PortMapping // Size of the container rootfs. Requires the size boolean to be true - Size *shared.ContainerSize + Size *define.ContainerSize // Time when container started StartedAt int64 // State of container diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index fc62a6c29..4279fb756 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -11,6 +11,8 @@ import ( "strings" "sync" + lpfilters "github.com/containers/libpod/libpod/filters" + "github.com/containers/buildah" "github.com/containers/common/pkg/config" "github.com/containers/image/v5/manifest" @@ -19,7 +21,6 @@ import ( "github.com/containers/libpod/libpod/events" "github.com/containers/libpod/libpod/image" "github.com/containers/libpod/libpod/logs" - "github.com/containers/libpod/pkg/api/handlers/utils" "github.com/containers/libpod/pkg/checkpoint" "github.com/containers/libpod/pkg/domain/entities" "github.com/containers/libpod/pkg/domain/infra/abi/terminal" @@ -175,9 +176,15 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin } func (ic *ContainerEngine) ContainerPrune(ctx context.Context, options entities.ContainerPruneOptions) (*entities.ContainerPruneReport, error) { - filterFuncs, err := utils.GenerateFilterFuncsFromMap(ic.Libpod, options.Filters) - if err != nil { - return nil, err + var filterFuncs []libpod.ContainerFilter + for k, v := range options.Filters { + for _, val := range v { + generatedFunc, err := lpfilters.GenerateContainerFilterFuncs(k, val, ic.Libpod) + if err != nil { + return nil, err + } + filterFuncs = append(filterFuncs, generatedFunc) + } } prunedContainers, pruneErrors, err := ic.Libpod.PruneContainers(filterFuncs) if err != nil { |