summaryrefslogtreecommitdiff
path: root/cmd/podman/unpause.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-11-07 13:20:43 -0600
committerbaude <bbaude@redhat.com>2018-11-08 15:18:11 -0600
commit2dd9cae37cb076418393ba61c0fb7b8cf97148f3 (patch)
tree346e95940f263a5ea770be6f11ebe4130e8e626b /cmd/podman/unpause.go
parentfa8cc1a94281aac1c52952a002f9c3dd31d91197 (diff)
downloadpodman-2dd9cae37cb076418393ba61c0fb7b8cf97148f3.tar.gz
podman-2dd9cae37cb076418393ba61c0fb7b8cf97148f3.tar.bz2
podman-2dd9cae37cb076418393ba61c0fb7b8cf97148f3.zip
rm -f now removes a paused container
We now can remove a paused container by sending it a kill signal while it is paused. We then unpause the container and it is immediately killed. Also, reworked how the parallelWorker results are handled to provide a more consistent approach to how each subcommand implements it. It also fixes a bug where if one container errors, the error message is duplicated when printed out. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/unpause.go')
-rw-r--r--cmd/podman/unpause.go18
1 files changed, 2 insertions, 16 deletions
diff --git a/cmd/podman/unpause.go b/cmd/podman/unpause.go
index 648fc9d3d..d77e056f8 100644
--- a/cmd/podman/unpause.go
+++ b/cmd/podman/unpause.go
@@ -1,7 +1,6 @@
package main
import (
- "fmt"
"os"
"github.com/containers/libpod/cmd/podman/libpodruntime"
@@ -37,7 +36,6 @@ var (
func unpauseCmd(c *cli.Context) error {
var (
- lastError error
unpauseContainers []*libpod.Container
unpauseFuncs []shared.ParallelWorkerInput
)
@@ -90,18 +88,6 @@ func unpauseCmd(c *cli.Context) error {
}
logrus.Debugf("Setting maximum workers to %d", maxWorkers)
- unpauseErrors := shared.ParallelExecuteWorkerPool(maxWorkers, unpauseFuncs)
-
- for cid, result := range unpauseErrors {
- if result != nil && result != libpod.ErrCtrStopped {
- if len(unpauseErrors) > 1 {
- fmt.Println(result.Error())
- }
- lastError = result
- continue
- }
- fmt.Println(cid)
- }
-
- return lastError
+ unpauseErrors, errCount := shared.ParallelExecuteWorkerPool(maxWorkers, unpauseFuncs)
+ return printParallelOutput(unpauseErrors, errCount)
}