diff options
author | flouthoc <flouthoc.git@gmail.com> | 2021-06-26 18:55:08 +0530 |
---|---|---|
committer | flouthoc <flouthoc.git@gmail.com> | 2021-06-30 09:04:08 +0530 |
commit | 2243b6020330ea06abdb594db9c6c8ff429cfc5d (patch) | |
tree | d868bbae55668546b5ab579a92a1308208db2e83 /pkg/domain/infra | |
parent | 0a0ade3cc00c3779bbf68ddd103d3efd10b5c25b (diff) | |
download | podman-2243b6020330ea06abdb594db9c6c8ff429cfc5d.tar.gz podman-2243b6020330ea06abdb594db9c6c8ff429cfc5d.tar.bz2 podman-2243b6020330ea06abdb594db9c6c8ff429cfc5d.zip |
reset: remove external containers on podman system reset
[NO TESTS NEEDED]
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 4 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index e6dd19e63..47fa553ce 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -854,6 +854,10 @@ func (ic *ContainerEngine) ContainerList(ctx context.Context, options entities.C return ps.GetContainerLists(ic.Libpod, options) } +func (ic *ContainerEngine) ContainerListExternal(ctx context.Context) ([]entities.ListContainer, error) { + return ps.GetExternalContainerLists(ic.Libpod) +} + // ContainerDiff provides changes to given container func (ic *ContainerEngine) ContainerDiff(ctx context.Context, nameOrID string, opts entities.DiffOptions) (*entities.DiffReport, error) { if opts.Latest { diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 0047fc839..ccebfffa4 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -646,6 +646,12 @@ func (ic *ContainerEngine) ContainerList(ctx context.Context, opts entities.Cont return containers.List(ic.ClientCtx, options) } +func (ic *ContainerEngine) ContainerListExternal(ctx context.Context) ([]entities.ListContainer, error) { + options := new(containers.ListOptions).WithAll(true) + options.WithNamespace(true).WithSize(true).WithSync(true).WithExternal(true) + return containers.List(ic.ClientCtx, options) +} + func (ic *ContainerEngine) ContainerRun(ctx context.Context, opts entities.ContainerRunOptions) (*entities.ContainerRunReport, error) { con, err := containers.CreateWithSpec(ic.ClientCtx, opts.Spec, nil) if err != nil { |