From a7b3310db567309e8c21c4c49a37de9d18646a4c Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Sat, 25 Apr 2020 13:51:33 -0500 Subject: enable integration tests for restart enable integrations tests for container restart. fixed bug where --running was not being honored. Signed-off-by: Brent Baude --- pkg/domain/infra/tunnel/containers.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/domain/infra/tunnel/containers.go') diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 18d6613f4..32f9c4e36 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -115,11 +115,15 @@ func (ic *ContainerEngine) ContainerRestart(ctx context.Context, namesOrIds []st t := int(*options.Timeout) timeout = &t } + ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds) if err != nil { return nil, err } for _, c := range ctrs { + if options.Running && c.State != define.ContainerStateRunning.String() { + continue + } reports = append(reports, &entities.RestartReport{ Id: c.ID, Err: containers.Restart(ic.ClientCxt, c.ID, timeout), -- cgit v1.2.3-54-g00ecf