summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/tunnel/containers.go
diff options
context:
space:
mode:
authorKarthik Elango <kelango@redhat.com>2022-06-28 15:31:20 -0400
committerKarthik Elango <kelango@redhat.com>2022-07-14 13:18:53 -0400
commita2f6cc74e72edf0b7045c8410ed3f45489999e2b (patch)
tree7424569f997630623d4290ace20ccf63cf743897 /pkg/domain/infra/tunnel/containers.go
parent3637d55191be2e9a5b9e13f8f62db4c27d188741 (diff)
downloadpodman-a2f6cc74e72edf0b7045c8410ed3f45489999e2b.tar.gz
podman-a2f6cc74e72edf0b7045c8410ed3f45489999e2b.tar.bz2
podman-a2f6cc74e72edf0b7045c8410ed3f45489999e2b.zip
Podman stop --filter flag
Filter flag is added for podman stop and podman --remote stop. Filtering logic is implemented in getContainersAndInputByContext(). Start filtering can be manipulated to use this logic as well to limit redundancy. Signed-off-by: Karthik Elango <kelango@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel/containers.go')
-rw-r--r--pkg/domain/infra/tunnel/containers.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go
index 5568ccde8..fcabff7c4 100644
--- a/pkg/domain/infra/tunnel/containers.go
+++ b/pkg/domain/infra/tunnel/containers.go
@@ -91,8 +91,7 @@ func (ic *ContainerEngine) ContainerUnpause(ctx context.Context, namesOrIds []st
}
func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []string, opts entities.StopOptions) ([]*entities.StopReport, error) {
- reports := []*entities.StopReport{}
- ctrs, rawInputs, err := getContainersAndInputByContext(ic.ClientCtx, opts.All, opts.Ignore, namesOrIds)
+ ctrs, rawInputs, err := getContainersAndInputByContext(ic.ClientCtx, opts.All, opts.Ignore, namesOrIds, opts.Filters)
if err != nil {
return nil, err
}
@@ -104,6 +103,7 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
if to := opts.Timeout; to != nil {
options.WithTimeout(*to)
}
+ reports := []*entities.StopReport{}
for _, c := range ctrs {
report := entities.StopReport{
Id: c.ID,
@@ -134,7 +134,7 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
}
func (ic *ContainerEngine) ContainerKill(ctx context.Context, namesOrIds []string, opts entities.KillOptions) ([]*entities.KillReport, error) {
- ctrs, rawInputs, err := getContainersAndInputByContext(ic.ClientCtx, opts.All, false, namesOrIds)
+ ctrs, rawInputs, err := getContainersAndInputByContext(ic.ClientCtx, opts.All, false, namesOrIds, nil)
if err != nil {
return nil, err
}