Skip to content

Commit

Permalink
Merge pull request #5614 from baude/v2containersfix
Browse files Browse the repository at this point in the history
podmanv2 add pre-run to each commmand
  • Loading branch information
openshift-merge-robot authored Mar 26, 2020
2 parents 18c1530 + 06e2a5d commit c869b96
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 28 deletions.
9 changes: 5 additions & 4 deletions cmd/podmanV2/containers/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
9 changes: 5 additions & 4 deletions cmd/podmanV2/containers/pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
9 changes: 5 additions & 4 deletions cmd/podmanV2/containers/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
9 changes: 5 additions & 4 deletions cmd/podmanV2/containers/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
9 changes: 5 additions & 4 deletions cmd/podmanV2/containers/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
9 changes: 5 additions & 4 deletions cmd/podmanV2/containers/unpause.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
}
Expand Down
9 changes: 5 additions & 4 deletions cmd/podmanV2/containers/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down

0 comments on commit c869b96

Please sign in to comment.