summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-05 17:33:19 +0000
committerGitHub <noreply@github.com>2022-07-05 17:33:19 +0000
commitcf747399b13432d000cfd9556a248681363dda2d (patch)
tree14ef73da2b1eb43ed41a1a89bd5582444938a16a /pkg/domain
parent39fc5d1f4f26f82ed1ca23d97f43924335c4c529 (diff)
parent65d511c6d859f250b6e45107315436e73f125c3a (diff)
downloadpodman-cf747399b13432d000cfd9556a248681363dda2d.tar.gz
podman-cf747399b13432d000cfd9556a248681363dda2d.tar.bz2
podman-cf747399b13432d000cfd9556a248681363dda2d.zip
Merge pull request #14370 from umohnani8/todo
Fix podman pod unpause TODO
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/infra/abi/pods.go8
-rw-r--r--pkg/domain/infra/tunnel/pods.go4
2 files changed, 12 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/pods.go b/pkg/domain/infra/abi/pods.go
index 0aaa5d73d..9a16f7fcd 100644
--- a/pkg/domain/infra/abi/pods.go
+++ b/pkg/domain/infra/abi/pods.go
@@ -159,6 +159,14 @@ func (ic *ContainerEngine) PodUnpause(ctx context.Context, namesOrIds []string,
return nil, err
}
for _, p := range pods {
+ status, err := p.GetPodStatus()
+ if err != nil {
+ return nil, err
+ }
+ // If the pod is not paused or degraded, there is no need to attempt an unpause on it
+ if status != define.PodStatePaused && status != define.PodStateDegraded {
+ continue
+ }
report := entities.PodUnpauseReport{Id: p.ID()}
errs, err := p.Unpause(ctx)
if err != nil && !errors.Is(err, define.ErrPodPartialFail) {
diff --git a/pkg/domain/infra/tunnel/pods.go b/pkg/domain/infra/tunnel/pods.go
index a524f9f89..bcbd32d1b 100644
--- a/pkg/domain/infra/tunnel/pods.go
+++ b/pkg/domain/infra/tunnel/pods.go
@@ -80,6 +80,10 @@ func (ic *ContainerEngine) PodUnpause(ctx context.Context, namesOrIds []string,
}
reports := make([]*entities.PodUnpauseReport, 0, len(foundPods))
for _, p := range foundPods {
+ // If the pod is not paused or degraded, there is no need to attempt an unpause on it
+ if p.Status != define.PodStatePaused && p.Status != define.PodStateDegraded {
+ continue
+ }
response, err := pods.Unpause(ic.ClientCtx, p.Id, nil)
if err != nil {
report := entities.PodUnpauseReport{