summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-27 20:27:36 +0200
committerGitHub <noreply@github.com>2020-04-27 20:27:36 +0200
commite90112a58c820fc20bf56727a3d1c19759ceed3e (patch)
treeb871c54a37ebdd00e6156284fd0d03d9b4ececf0 /pkg/domain/infra/abi
parent5554698a4463a6d2543d3427d6e5e3d1ba3804fe (diff)
parenta7b3310db567309e8c21c4c49a37de9d18646a4c (diff)
downloadpodman-e90112a58c820fc20bf56727a3d1c19759ceed3e.tar.gz
podman-e90112a58c820fc20bf56727a3d1c19759ceed3e.tar.bz2
podman-e90112a58c820fc20bf56727a3d1c19759ceed3e.zip
Merge pull request #5984 from baude/v2intrestart
enable integration tests for restart
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r--pkg/domain/infra/abi/containers.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index 9844d1d96..e09891760 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -217,12 +217,23 @@ func (ic *ContainerEngine) ContainerKill(ctx context.Context, namesOrIds []strin
}
func (ic *ContainerEngine) ContainerRestart(ctx context.Context, namesOrIds []string, options entities.RestartOptions) ([]*entities.RestartReport, error) {
var (
+ ctrs []*libpod.Container
+ err error
reports []*entities.RestartReport
)
- ctrs, err := getContainersByContext(options.All, options.Latest, namesOrIds, ic.Libpod)
- if err != nil {
- return nil, err
+
+ if options.Running {
+ ctrs, err = ic.Libpod.GetRunningContainers()
+ if err != nil {
+ return nil, err
+ }
+ } else {
+ ctrs, err = getContainersByContext(options.All, options.Latest, namesOrIds, ic.Libpod)
+ if err != nil {
+ return nil, err
+ }
}
+
for _, con := range ctrs {
timeout := con.StopTimeout()
if options.Timeout != nil {