diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-08-05 06:43:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-05 06:43:56 +0000 |
commit | 49ee311950470ef910b244b2bca78b9c8c645422 (patch) | |
tree | 5d29573585027c7cd3edfc0fd39c064cf564b96b /pkg/domain/infra/tunnel/containers.go | |
parent | b0ef621ebf196fd61189aebff3161927f0049c52 (diff) | |
parent | 9964366f69a1fbaa709e45c3d3ebcada283a76b7 (diff) | |
download | podman-49ee311950470ef910b244b2bca78b9c8c645422.tar.gz podman-49ee311950470ef910b244b2bca78b9c8c645422.tar.bz2 podman-49ee311950470ef910b244b2bca78b9c8c645422.zip |
Merge pull request #15092 from karthikelango137/startFilter
start --filter flag changes
Diffstat (limited to 'pkg/domain/infra/tunnel/containers.go')
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 225aee017..81fb6aef8 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -658,36 +658,7 @@ func logIfRmError(id string, err error, reports []*reports.RmReport) { func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []string, options entities.ContainerStartOptions) ([]*entities.ContainerStartReport, error) { reports := []*entities.ContainerStartReport{} var exitCode = define.ExecErrorCodeGeneric - containersNamesOrIds := namesOrIds - all := options.All - if len(options.Filters) > 0 { - all = false - containersNamesOrIds = []string{} - opts := new(containers.ListOptions).WithFilters(options.Filters).WithAll(true) - candidates, listErr := containers.List(ic.ClientCtx, opts) - if listErr != nil { - return nil, listErr - } - for _, candidate := range candidates { - if options.All { - containersNamesOrIds = append(containersNamesOrIds, candidate.ID) - continue - } - for _, nameOrID := range namesOrIds { - if nameOrID == candidate.ID { - containersNamesOrIds = append(containersNamesOrIds, nameOrID) - continue - } - for _, containerName := range candidate.Names { - if containerName == nameOrID { - containersNamesOrIds = append(containersNamesOrIds, nameOrID) - continue - } - } - } - } - } - ctrs, err := getContainersByContext(ic.ClientCtx, all, false, containersNamesOrIds) + ctrs, namesOrIds, err := getContainersAndInputByContext(ic.ClientCtx, options.All, false, namesOrIds, options.Filters) if err != nil { return nil, err } |