mirror of
https://github.com/containers/podman.git
synced 2025-06-19 16:33:24 +08:00
podmanv2 add pre-run to each commmand
each container command needs a prerune because it is not part of the containers subcommand yet Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
@ -19,6 +19,7 @@ var (
|
|||||||
Short: "Kill one or more running containers with a specific signal",
|
Short: "Kill one or more running containers with a specific signal",
|
||||||
Long: killDescription,
|
Long: killDescription,
|
||||||
RunE: kill,
|
RunE: kill,
|
||||||
|
PersistentPreRunE: preRunE,
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
|
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
|
||||||
},
|
},
|
||||||
|
@ -19,6 +19,7 @@ var (
|
|||||||
Short: "Pause all the processes in one or more containers",
|
Short: "Pause all the processes in one or more containers",
|
||||||
Long: pauseDescription,
|
Long: pauseDescription,
|
||||||
RunE: pause,
|
RunE: pause,
|
||||||
|
PersistentPreRunE: preRunE,
|
||||||
Example: `podman pause mywebserver
|
Example: `podman pause mywebserver
|
||||||
podman pause 860a4b23
|
podman pause 860a4b23
|
||||||
podman pause -a`,
|
podman pause -a`,
|
||||||
|
@ -22,6 +22,7 @@ var (
|
|||||||
Short: "Restart one or more containers",
|
Short: "Restart one or more containers",
|
||||||
Long: restartDescription,
|
Long: restartDescription,
|
||||||
RunE: restart,
|
RunE: restart,
|
||||||
|
PersistentPreRunE: preRunE,
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
|
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
|
||||||
},
|
},
|
||||||
|
@ -23,6 +23,7 @@ var (
|
|||||||
Short: "Remove one or more containers",
|
Short: "Remove one or more containers",
|
||||||
Long: rmDescription,
|
Long: rmDescription,
|
||||||
RunE: rm,
|
RunE: rm,
|
||||||
|
PersistentPreRunE: preRunE,
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
|
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
|
||||||
},
|
},
|
||||||
|
@ -22,6 +22,7 @@ var (
|
|||||||
Short: "Stop one or more containers",
|
Short: "Stop one or more containers",
|
||||||
Long: stopDescription,
|
Long: stopDescription,
|
||||||
RunE: stop,
|
RunE: stop,
|
||||||
|
PersistentPreRunE: preRunE,
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
|
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
|
||||||
},
|
},
|
||||||
|
@ -19,6 +19,7 @@ var (
|
|||||||
Short: "Unpause the processes in one or more containers",
|
Short: "Unpause the processes in one or more containers",
|
||||||
Long: unpauseDescription,
|
Long: unpauseDescription,
|
||||||
RunE: unpause,
|
RunE: unpause,
|
||||||
|
PersistentPreRunE: preRunE,
|
||||||
Example: `podman unpause ctrID
|
Example: `podman unpause ctrID
|
||||||
podman unpause --all`,
|
podman unpause --all`,
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ var (
|
|||||||
Short: "Block on one or more containers",
|
Short: "Block on one or more containers",
|
||||||
Long: waitDescription,
|
Long: waitDescription,
|
||||||
RunE: wait,
|
RunE: wait,
|
||||||
|
PersistentPreRunE: preRunE,
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
|
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user