mirror of
https://github.com/containers/podman.git
synced 2025-12-09 15:19:35 +08:00
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>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user