summaryrefslogtreecommitdiff
path: root/cmd/podman/pause.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/pause.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/pause.go')
-rw-r--r--cmd/podman/pause.go17
1 files changed, 2 insertions, 15 deletions
diff --git a/cmd/podman/pause.go b/cmd/podman/pause.go
index 1e1585216..fcb2f3cb8 100644
--- a/cmd/podman/pause.go
+++ b/cmd/podman/pause.go
@@ -1,7 +1,6 @@
package main
import (
- "fmt"
"os"
"github.com/containers/libpod/cmd/podman/libpodruntime"
@@ -37,7 +36,6 @@ var (
func pauseCmd(c *cli.Context) error {
var (
- lastError error
pauseContainers []*libpod.Container
pauseFuncs []shared.ParallelWorkerInput
)
@@ -90,17 +88,6 @@ func pauseCmd(c *cli.Context) error {
}
logrus.Debugf("Setting maximum workers to %d", maxWorkers)
- pauseErrors := shared.ParallelExecuteWorkerPool(maxWorkers, pauseFuncs)
-
- for cid, result := range pauseErrors {
- if result != nil {
- if len(pauseErrors) > 1 {
- fmt.Println(result.Error())
- }
- lastError = result
- continue
- }
- fmt.Println(cid)
- }
- return lastError
+ pauseErrors, errCount := shared.ParallelExecuteWorkerPool(maxWorkers, pauseFuncs)
+ return printParallelOutput(pauseErrors, errCount)
}