diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-15 16:12:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 16:12:13 -0400 |
commit | b422a4eb49182f6b90dae9ed041546cc46cc59db (patch) | |
tree | c4dacae909dd97b1477a0e58ceec2913df3e585c /pkg/domain/infra/tunnel/containers.go | |
parent | 463a5a7db5b096f225324d9c2c40e40a47f6e7c2 (diff) | |
parent | 302b3084ebadb13a0b203eac63e24b0e5d3535a0 (diff) | |
download | podman-b422a4eb49182f6b90dae9ed041546cc46cc59db.tar.gz podman-b422a4eb49182f6b90dae9ed041546cc46cc59db.tar.bz2 podman-b422a4eb49182f6b90dae9ed041546cc46cc59db.zip |
Merge pull request #10595 from boaz0/closes_10539
Add podman-restart systemd unit file
Diffstat (limited to 'pkg/domain/infra/tunnel/containers.go')
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 74ced300a..0047fc839 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -508,7 +508,9 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri 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) @@ -516,6 +518,10 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri 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) @@ -530,7 +536,7 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri } } } - ctrs, err := getContainersByContext(ic.ClientCtx, options.All, false, containersNamesOrIds) + ctrs, err := getContainersByContext(ic.ClientCtx, all, false, containersNamesOrIds) if err != nil { return nil, err } |