mirror of
https://github.com/containers/podman.git
synced 2025-06-17 23:20:59 +08:00
Merge pull request #2700 from edsantiago/podman_umount_args
podman umount: error out if called with no args
This commit is contained in:
@ -57,8 +57,8 @@ func generateKubeYAMLCmd(c *cliconfig.GenerateKubeValues) error {
|
|||||||
return errors.Wrapf(libpod.ErrNotImplemented, "rootless users")
|
return errors.Wrapf(libpod.ErrNotImplemented, "rootless users")
|
||||||
}
|
}
|
||||||
args := c.InputArgs
|
args := c.InputArgs
|
||||||
if len(args) > 1 || (len(args) < 1 && !c.Bool("latest")) {
|
if len(args) != 1 {
|
||||||
return errors.Errorf("you must provide one container|pod ID or name or --latest")
|
return errors.Errorf("you must provide exactly one container|pod ID or name")
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
|
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
|
||||||
|
@ -25,7 +25,7 @@ var (
|
|||||||
`
|
`
|
||||||
|
|
||||||
_mountCommand = &cobra.Command{
|
_mountCommand = &cobra.Command{
|
||||||
Use: "mount [flags] CONTAINER",
|
Use: "mount [flags] [CONTAINER]",
|
||||||
Short: "Mount a working container's root filesystem",
|
Short: "Mount a working container's root filesystem",
|
||||||
Long: mountDescription,
|
Long: mountDescription,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
@ -25,7 +25,7 @@ var (
|
|||||||
podStatsDescription = `For each specified pod this command will display percentage of CPU, memory, network I/O, block I/O and PIDs for containers in one the pods.`
|
podStatsDescription = `For each specified pod this command will display percentage of CPU, memory, network I/O, block I/O and PIDs for containers in one the pods.`
|
||||||
|
|
||||||
_podStatsCommand = &cobra.Command{
|
_podStatsCommand = &cobra.Command{
|
||||||
Use: "stats [flags] POD [POD...]",
|
Use: "stats [flags] [POD...]",
|
||||||
Short: "Display a live stream of resource usage statistics for the containers in one or more pods",
|
Short: "Display a live stream of resource usage statistics for the containers in one or more pods",
|
||||||
Long: podStatsDescription,
|
Long: podStatsDescription,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
@ -31,7 +31,7 @@ var (
|
|||||||
return umountCmd(&umountCommand)
|
return umountCmd(&umountCommand)
|
||||||
},
|
},
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
return checkAllAndLatest(cmd, args, true)
|
return checkAllAndLatest(cmd, args, false)
|
||||||
},
|
},
|
||||||
Example: `podman umount ctrID
|
Example: `podman umount ctrID
|
||||||
podman umount ctrID1 ctrID2 ctrID3
|
podman umount ctrID1 ctrID2 ctrID3
|
||||||
|
Reference in New Issue
Block a user