diff options
author | Brent Baude <bbaude@redhat.com> | 2020-03-20 14:00:05 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-03-20 14:33:33 -0500 |
commit | c81e065149da73ae904aa19ee46a23d1ab8ce55c (patch) | |
tree | 52a8692894690a8f09e025f90d6d2b5045259e4f /pkg/domain/infra/tunnel/containers.go | |
parent | 4a00409bf8c88174cbdbc12760d3f8ddce9621de (diff) | |
download | podman-c81e065149da73ae904aa19ee46a23d1ab8ce55c.tar.gz podman-c81e065149da73ae904aa19ee46a23d1ab8ce55c.tar.bz2 podman-c81e065149da73ae904aa19ee46a23d1ab8ce55c.zip |
podmanv2 enable remote wait
enable remote container wait with condition
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel/containers.go')
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index d2d93d51b..8bf74126d 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -13,7 +13,24 @@ func (ic *ContainerEngine) ContainerExists(ctx context.Context, nameOrId string) } func (ic *ContainerEngine) ContainerWait(ctx context.Context, namesOrIds []string, options entities.WaitOptions) ([]entities.WaitReport, error) { - return nil, nil + var ( + responses []entities.WaitReport + ) + cons, err := getContainersByContext(ic.ClientCxt, false, namesOrIds) + if err != nil { + return nil, err + } + for _, c := range cons { + response := entities.WaitReport{Id: c.ID} + exitCode, err := containers.Wait(ic.ClientCxt, c.ID, &options.Condition) + if err != nil { + response.Error = err + } else { + response.ExitCode = exitCode + } + responses = append(responses, response) + } + return responses, nil } func (r *ContainerEngine) ContainerDelete(ctx context.Context, opts entities.ContainerDeleteOptions) (*entities.ContainerDeleteReport, error) { |