summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-26 14:12:18 +0100
committerGitHub <noreply@github.com>2020-03-26 14:12:18 +0100
commitc869b96d777d12a7d9ef191976d4131270d68858 (patch)
tree62d4ca346302f48ecd0ca523d86f547d5a4e0d15
parent18c15300b2f904f5c88ffd9876dec5b493332ca8 (diff)
parent06e2a5dd869bff583f2cc3b109e4b4526fdfd01c (diff)
downloadpodman-c869b96d777d12a7d9ef191976d4131270d68858.tar.gz
podman-c869b96d777d12a7d9ef191976d4131270d68858.tar.bz2
podman-c869b96d777d12a7d9ef191976d4131270d68858.zip
Merge pull request #5614 from baude/v2containersfix
podmanv2 add pre-run to each commmand
-rw-r--r--cmd/podmanV2/containers/kill.go9
-rw-r--r--cmd/podmanV2/containers/pause.go9
-rw-r--r--cmd/podmanV2/containers/restart.go9
-rw-r--r--cmd/podmanV2/containers/rm.go9
-rw-r--r--cmd/podmanV2/containers/stop.go9
-rw-r--r--cmd/podmanV2/containers/unpause.go9
-rw-r--r--cmd/podmanV2/containers/wait.go9
7 files changed, 35 insertions, 28 deletions
diff --git a/cmd/podmanV2/containers/kill.go b/cmd/podmanV2/containers/kill.go
index 36c4f2528..6e6debfec 100644
--- a/cmd/podmanV2/containers/kill.go
+++ b/cmd/podmanV2/containers/kill.go
@@ -15,10 +15,11 @@ import (
var (
killDescription = "The main process inside each container specified will be sent SIGKILL, or any signal specified with option --signal."
killCommand = &cobra.Command{
- Use: "kill [flags] CONTAINER [CONTAINER...]",
- Short: "Kill one or more running containers with a specific signal",
- Long: killDescription,
- RunE: kill,
+ Use: "kill [flags] CONTAINER [CONTAINER...]",
+ Short: "Kill one or more running containers with a specific signal",
+ Long: killDescription,
+ RunE: kill,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
},
diff --git a/cmd/podmanV2/containers/pause.go b/cmd/podmanV2/containers/pause.go
index 99ca34d5c..a9b91b68f 100644
--- a/cmd/podmanV2/containers/pause.go
+++ b/cmd/podmanV2/containers/pause.go
@@ -15,10 +15,11 @@ import (
var (
pauseDescription = `Pauses one or more running containers. The container name or ID can be used.`
pauseCommand = &cobra.Command{
- Use: "pause [flags] CONTAINER [CONTAINER...]",
- Short: "Pause all the processes in one or more containers",
- Long: pauseDescription,
- RunE: pause,
+ Use: "pause [flags] CONTAINER [CONTAINER...]",
+ Short: "Pause all the processes in one or more containers",
+ Long: pauseDescription,
+ RunE: pause,
+ PersistentPreRunE: preRunE,
Example: `podman pause mywebserver
podman pause 860a4b23
podman pause -a`,
diff --git a/cmd/podmanV2/containers/restart.go b/cmd/podmanV2/containers/restart.go
index 216824389..053891f79 100644
--- a/cmd/podmanV2/containers/restart.go
+++ b/cmd/podmanV2/containers/restart.go
@@ -18,10 +18,11 @@ var (
A timeout before forcibly stopping can be set, but defaults to 10 seconds.`
restartCommand = &cobra.Command{
- Use: "restart [flags] CONTAINER [CONTAINER...]",
- Short: "Restart one or more containers",
- Long: restartDescription,
- RunE: restart,
+ Use: "restart [flags] CONTAINER [CONTAINER...]",
+ Short: "Restart one or more containers",
+ Long: restartDescription,
+ RunE: restart,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
},
diff --git a/cmd/podmanV2/containers/rm.go b/cmd/podmanV2/containers/rm.go
index 916dd2577..75655e4cd 100644
--- a/cmd/podmanV2/containers/rm.go
+++ b/cmd/podmanV2/containers/rm.go
@@ -19,10 +19,11 @@ var (
Command does not remove images. Running or unusable containers will not be removed without the -f option.`
rmCommand = &cobra.Command{
- Use: "rm [flags] CONTAINER [CONTAINER...]",
- Short: "Remove one or more containers",
- Long: rmDescription,
- RunE: rm,
+ Use: "rm [flags] CONTAINER [CONTAINER...]",
+ Short: "Remove one or more containers",
+ Long: rmDescription,
+ RunE: rm,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
},
diff --git a/cmd/podmanV2/containers/stop.go b/cmd/podmanV2/containers/stop.go
index b6d70784d..58d47fd52 100644
--- a/cmd/podmanV2/containers/stop.go
+++ b/cmd/podmanV2/containers/stop.go
@@ -18,10 +18,11 @@ var (
A timeout to forcibly stop the container can also be set but defaults to 10 seconds otherwise.`
stopCommand = &cobra.Command{
- Use: "stop [flags] CONTAINER [CONTAINER...]",
- Short: "Stop one or more containers",
- Long: stopDescription,
- RunE: stop,
+ Use: "stop [flags] CONTAINER [CONTAINER...]",
+ Short: "Stop one or more containers",
+ Long: stopDescription,
+ RunE: stop,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
},
diff --git a/cmd/podmanV2/containers/unpause.go b/cmd/podmanV2/containers/unpause.go
index 8b8cde9b2..6a3179f10 100644
--- a/cmd/podmanV2/containers/unpause.go
+++ b/cmd/podmanV2/containers/unpause.go
@@ -15,10 +15,11 @@ import (
var (
unpauseDescription = `Unpauses one or more previously paused containers. The container name or ID can be used.`
unpauseCommand = &cobra.Command{
- Use: "unpause [flags] CONTAINER [CONTAINER...]",
- Short: "Unpause the processes in one or more containers",
- Long: unpauseDescription,
- RunE: unpause,
+ Use: "unpause [flags] CONTAINER [CONTAINER...]",
+ Short: "Unpause the processes in one or more containers",
+ Long: unpauseDescription,
+ RunE: unpause,
+ PersistentPreRunE: preRunE,
Example: `podman unpause ctrID
podman unpause --all`,
}
diff --git a/cmd/podmanV2/containers/wait.go b/cmd/podmanV2/containers/wait.go
index 4367fd9d9..bf3c86200 100644
--- a/cmd/podmanV2/containers/wait.go
+++ b/cmd/podmanV2/containers/wait.go
@@ -18,10 +18,11 @@ var (
waitDescription = `Block until one or more containers stop and then print their exit codes.
`
waitCommand = &cobra.Command{
- Use: "wait [flags] CONTAINER [CONTAINER...]",
- Short: "Block on one or more containers",
- Long: waitDescription,
- RunE: wait,
+ Use: "wait [flags] CONTAINER [CONTAINER...]",
+ Short: "Block on one or more containers",
+ Long: waitDescription,
+ RunE: wait,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
},