summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/containers.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-12 13:15:35 -0500
committerGitHub <noreply@github.com>2021-01-12 13:15:35 -0500
commitdb5e7ec4c42adf8ff97d9b19116ab6dbcbb616cd (patch)
treea1afbf91732f4b20b2cbacb460a3b7b60d6b6919 /pkg/domain/infra/abi/containers.go
parent0ccc88813e3e3a385ecdefbe971c1664193cd682 (diff)
parent8452b768ec96e84cd09766bddb65a34835844d6d (diff)
downloadpodman-db5e7ec4c42adf8ff97d9b19116ab6dbcbb616cd.tar.gz
podman-db5e7ec4c42adf8ff97d9b19116ab6dbcbb616cd.tar.bz2
podman-db5e7ec4c42adf8ff97d9b19116ab6dbcbb616cd.zip
Merge pull request #8947 from Luap99/cleanup-code
Fix problems reported by staticcheck
Diffstat (limited to 'pkg/domain/infra/abi/containers.go')
-rw-r--r--pkg/domain/infra/abi/containers.go20
1 files changed, 2 insertions, 18 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index 2c79b6187..b5f5a0e91 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -113,15 +113,7 @@ func (ic *ContainerEngine) ContainerWait(ctx context.Context, namesOrIds []strin
}
func (ic *ContainerEngine) ContainerPause(ctx context.Context, namesOrIds []string, options entities.PauseUnPauseOptions) ([]*entities.PauseUnpauseReport, error) {
- var (
- err error
- )
- ctrs := []*libpod.Container{} //nolint
- if options.All {
- ctrs, err = ic.Libpod.GetAllContainers()
- } else {
- ctrs, err = getContainersByContext(false, false, namesOrIds, ic.Libpod)
- }
+ ctrs, err := getContainersByContext(options.All, false, namesOrIds, ic.Libpod)
if err != nil {
return nil, err
}
@@ -134,15 +126,7 @@ func (ic *ContainerEngine) ContainerPause(ctx context.Context, namesOrIds []stri
}
func (ic *ContainerEngine) ContainerUnpause(ctx context.Context, namesOrIds []string, options entities.PauseUnPauseOptions) ([]*entities.PauseUnpauseReport, error) {
- var (
- err error
- )
- ctrs := []*libpod.Container{} //nolint
- if options.All {
- ctrs, err = ic.Libpod.GetAllContainers()
- } else {
- ctrs, err = getContainersByContext(false, false, namesOrIds, ic.Libpod)
- }
+ ctrs, err := getContainersByContext(options.All, false, namesOrIds, ic.Libpod)
if err != nil {
return nil, err
}