diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-15 10:52:12 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-15 16:09:27 -0500 |
commit | 30d2964ff83387e3c3fa7447776c57f4342707e6 (patch) | |
tree | 1b70767f9156152b3198910d03f9b1bdd6a363a9 /pkg/domain/infra/abi/containers.go | |
parent | 6e9622aa987bba37026fe628bffb5958d4cf64cb (diff) | |
download | podman-30d2964ff83387e3c3fa7447776c57f4342707e6.tar.gz podman-30d2964ff83387e3c3fa7447776c57f4342707e6.tar.bz2 podman-30d2964ff83387e3c3fa7447776c57f4342707e6.zip |
v2 bloat pruning phase 2
this is second phase of removing unneeded bloat in the remote client. this is important to be able to reduce the client size as well as possible native compilation for windows/mac.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/containers.go')
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 15 |
1 files changed, 11 insertions, 4 deletions
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 { |