summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-02-22 22:10:07 +0100
committerGitHub <noreply@github.com>2019-02-22 22:10:07 +0100
commit84b3f2a7f622636e622416403d1f2642edbbd117 (patch)
tree56abfe745ffb65c6fbb75824807345c217d684f8
parentc757cb23ca15634077a8b9fa33aba7abd1c8249b (diff)
parent6ab6e2c3073d47755d441ee8c1bce90e34082e99 (diff)
downloadpodman-84b3f2a7f622636e622416403d1f2642edbbd117.tar.gz
podman-84b3f2a7f622636e622416403d1f2642edbbd117.tar.bz2
podman-84b3f2a7f622636e622416403d1f2642edbbd117.zip
Merge pull request #2386 from baude/cobravalidation
Improve command line validation
-rw-r--r--cmd/podman/attach.go2
-rw-r--r--cmd/podman/checkpoint.go9
-rw-r--r--cmd/podman/cleanup.go8
-rw-r--r--cmd/podman/commands.go2
-rw-r--r--cmd/podman/commands_remoteclient.go2
-rw-r--r--cmd/podman/common.go23
-rw-r--r--cmd/podman/exec.go2
-rw-r--r--cmd/podman/inspect.go2
-rw-r--r--cmd/podman/kill.go8
-rw-r--r--cmd/podman/logs.go1
-rw-r--r--cmd/podman/mount.go4
-rw-r--r--cmd/podman/pod_inspect.go4
-rw-r--r--cmd/podman/pod_kill.go8
-rw-r--r--cmd/podman/pod_pause.go8
-rw-r--r--cmd/podman/pod_ps.go2
-rw-r--r--cmd/podman/pod_restart.go8
-rw-r--r--cmd/podman/pod_rm.go8
-rw-r--r--cmd/podman/pod_start.go8
-rw-r--r--cmd/podman/pod_stats.go1
-rw-r--r--cmd/podman/pod_stop.go8
-rw-r--r--cmd/podman/pod_unpause.go8
-rw-r--r--cmd/podman/port.go4
-rw-r--r--cmd/podman/ps.go1
-rw-r--r--cmd/podman/restart.go4
-rw-r--r--cmd/podman/restore.go8
-rw-r--r--cmd/podman/rm.go8
-rw-r--r--cmd/podman/save.go21
-rw-r--r--cmd/podman/start.go1
-rw-r--r--cmd/podman/stats.go4
-rw-r--r--cmd/podman/stop.go8
-rw-r--r--cmd/podman/top.go1
-rw-r--r--cmd/podman/umount.go7
-rw-r--r--cmd/podman/utils.go16
-rw-r--r--cmd/podman/wait.go1
-rw-r--r--docs/podman-attach.1.md2
-rw-r--r--docs/podman-container-checkpoint.1.md2
-rw-r--r--docs/podman-container-cleanup.1.md3
-rw-r--r--docs/podman-container-restore.1.md2
-rw-r--r--docs/podman-diff.1.md6
-rw-r--r--docs/podman-exec.1.md2
-rw-r--r--docs/podman-inspect.1.md2
-rw-r--r--docs/podman-kill.1.md2
-rw-r--r--docs/podman-load.1.md4
-rw-r--r--docs/podman-logs.1.md7
-rw-r--r--docs/podman-mount.1.md2
-rw-r--r--docs/podman-pod-inspect.1.md1
-rw-r--r--docs/podman-pod-kill.1.md2
-rw-r--r--docs/podman-pod-pause.1.md2
-rw-r--r--docs/podman-pod-ps.1.md2
-rw-r--r--docs/podman-pod-restart.1.md2
-rw-r--r--docs/podman-pod-rm.1.md2
-rw-r--r--docs/podman-pod-start.1.md2
-rw-r--r--docs/podman-pod-stop.1.md2
-rw-r--r--docs/podman-pod-top.1.md2
-rw-r--r--docs/podman-pod-unpause.1.md2
-rw-r--r--docs/podman-port.1.md2
-rw-r--r--docs/podman-ps.1.md2
-rw-r--r--docs/podman-restart.1.md2
-rw-r--r--docs/podman-rm.1.md2
-rw-r--r--docs/podman-start.1.md1
-rw-r--r--docs/podman-stats.1.md2
-rw-r--r--docs/podman-stop.1.md2
-rw-r--r--docs/podman-top.1.md2
-rw-r--r--docs/podman-umount.1.md2
-rw-r--r--docs/podman-wait.1.md4
65 files changed, 202 insertions, 82 deletions
diff --git a/cmd/podman/attach.go b/cmd/podman/attach.go
index b70ff649c..074675e45 100644
--- a/cmd/podman/attach.go
+++ b/cmd/podman/attach.go
@@ -35,8 +35,8 @@ func init() {
flags.StringVar(&attachCommand.DetachKeys, "detach-keys", "", "Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _")
flags.BoolVar(&attachCommand.NoStdin, "no-stdin", false, "Do not attach STDIN. The default is false")
flags.BoolVar(&attachCommand.SigProxy, "sig-proxy", true, "Proxy received signals to the process (default true)")
-
flags.BoolVarP(&attachCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func attachCmd(c *cliconfig.AttachValues) error {
diff --git a/cmd/podman/checkpoint.go b/cmd/podman/checkpoint.go
index 3484e8957..c9de5638b 100644
--- a/cmd/podman/checkpoint.go
+++ b/cmd/podman/checkpoint.go
@@ -29,6 +29,9 @@ var (
checkpointCommand.GlobalFlags = MainGlobalOpts
return checkpointCmd(&checkpointCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman checkpoint --keep ctrID
podman checkpoint --all
podman checkpoint --leave-running --latest`,
@@ -45,6 +48,7 @@ func init() {
flags.BoolVar(&checkpointCommand.TcpEstablished, "tcp-established", false, "Checkpoint a container with established TCP connections")
flags.BoolVarP(&checkpointCommand.All, "all", "a", false, "Checkpoint all running containers")
flags.BoolVarP(&checkpointCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func checkpointCmd(c *cliconfig.CheckpointValues) error {
@@ -63,11 +67,6 @@ func checkpointCmd(c *cliconfig.CheckpointValues) error {
KeepRunning: c.LeaveRunning,
TCPEstablished: c.TcpEstablished,
}
-
- if err := checkAllAndLatest(&c.PodmanCommand); err != nil {
- return err
- }
-
containers, lastError := getAllOrLatestContainers(&c.PodmanCommand, runtime, libpod.ContainerStateRunning, "running")
for _, ctr := range containers {
diff --git a/cmd/podman/cleanup.go b/cmd/podman/cleanup.go
index 89a4ba050..d68255aa2 100644
--- a/cmd/podman/cleanup.go
+++ b/cmd/podman/cleanup.go
@@ -26,6 +26,9 @@ var (
cleanupCommand.GlobalFlags = MainGlobalOpts
return cleanupCmd(&cleanupCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman container cleanup --latest
podman container cleanup ctrID1 ctrID2 ctrID3
podman container cleanup --all`,
@@ -40,6 +43,7 @@ func init() {
flags.BoolVarP(&cleanupCommand.All, "all", "a", false, "Cleans up all containers")
flags.BoolVarP(&cleanupCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
flags.BoolVar(&cleanupCommand.Remove, "rm", false, "After cleanup, remove the container entirely")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func cleanupCmd(c *cliconfig.CleanupValues) error {
@@ -49,10 +53,6 @@ func cleanupCmd(c *cliconfig.CleanupValues) error {
}
defer runtime.Shutdown(false)
- if err := checkAllAndLatest(&c.PodmanCommand); err != nil {
- return err
- }
-
cleanupContainers, lastError := getAllOrLatestContainers(&c.PodmanCommand, runtime, -1, "all")
ctx := getContext()
diff --git a/cmd/podman/commands.go b/cmd/podman/commands.go
index f323c2d9a..d8fc44c2f 100644
--- a/cmd/podman/commands.go
+++ b/cmd/podman/commands.go
@@ -6,6 +6,8 @@ import (
"github.com/spf13/cobra"
)
+const remoteclient = false
+
// Commands that the local client implements
func getMainCommands() []*cobra.Command {
rootCommands := []*cobra.Command{
diff --git a/cmd/podman/commands_remoteclient.go b/cmd/podman/commands_remoteclient.go
index ba0a4d47e..081043b25 100644
--- a/cmd/podman/commands_remoteclient.go
+++ b/cmd/podman/commands_remoteclient.go
@@ -6,6 +6,8 @@ import (
"github.com/spf13/cobra"
)
+const remoteclient = true
+
// commands that only the remoteclient implements
func getMainCommands() []*cobra.Command {
return []*cobra.Command{}
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index fed07de7c..e297f3921 100644
--- a/cmd/podman/common.go
+++ b/cmd/podman/common.go
@@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
+ "github.com/spf13/cobra"
"os"
"strings"
@@ -36,16 +37,24 @@ func shortID(id string) string {
}
// checkAllAndLatest checks that --all and --latest are used correctly
-func checkAllAndLatest(c *cliconfig.PodmanCommand) error {
- argLen := len(c.InputArgs)
- if (c.Bool("all") || c.Bool("latest")) && argLen > 0 {
- return errors.Errorf("no arguments are needed with --all or --latest")
+func checkAllAndLatest(c *cobra.Command, args []string, ignoreArgLen bool) error {
+ argLen := len(args)
+ if c.Flags().Lookup("all") == nil || c.Flags().Lookup("latest") == nil {
+ return errors.New("unable to lookup values for 'latest' or 'all'")
}
- if c.Bool("all") && c.Bool("latest") {
+ all, _ := c.Flags().GetBool("all")
+ latest, _ := c.Flags().GetBool("latest")
+ if all && latest {
return errors.Errorf("--all and --latest cannot be used together")
}
- if argLen < 1 && !c.Bool("all") && !c.Bool("latest") {
- return errors.Errorf("you must provide at least one pod name or id")
+ if ignoreArgLen {
+ return nil
+ }
+ if (all || latest) && argLen > 0 {
+ return errors.Errorf("no arguments are needed with --all or --latest")
+ }
+ if argLen < 1 && !all && !latest {
+ return errors.Errorf("you must provide at least one name or id")
}
return nil
}
diff --git a/cmd/podman/exec.go b/cmd/podman/exec.go
index 9599be528..7040a7b09 100644
--- a/cmd/podman/exec.go
+++ b/cmd/podman/exec.go
@@ -48,7 +48,7 @@ func init() {
flags.StringVarP(&execCommand.User, "user", "u", "", "Sets the username or UID used and optionally the groupname or GID for the specified command")
flags.StringVarP(&execCommand.Workdir, "workdir", "w", "", "Working directory inside the container")
-
+ markFlagHiddenForRemoteClient("latest", flags)
}
func execCmd(c *cliconfig.ExecValues) error {
diff --git a/cmd/podman/inspect.go b/cmd/podman/inspect.go
index a1f3ef81f..48b953207 100644
--- a/cmd/podman/inspect.go
+++ b/cmd/podman/inspect.go
@@ -48,7 +48,7 @@ func init() {
flags.StringVarP(&inspectCommand.Format, "format", "f", "", "Change the output format to a Go template")
flags.BoolVarP(&inspectCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of if the type is a container")
flags.BoolVarP(&inspectCommand.Size, "size", "s", false, "Display total file size if the type is container")
-
+ markFlagHiddenForRemoteClient("latest", flags)
}
func inspectCmd(c *cliconfig.InspectValues) error {
diff --git a/cmd/podman/kill.go b/cmd/podman/kill.go
index 1be4fa959..eb72d53e7 100644
--- a/cmd/podman/kill.go
+++ b/cmd/podman/kill.go
@@ -28,6 +28,9 @@ var (
killCommand.GlobalFlags = MainGlobalOpts
return killCmd(&killCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman kill mywebserver
podman kill 860a4b23
podman kill --signal TERM ctrID`,
@@ -43,6 +46,7 @@ func init() {
flags.StringVarP(&killCommand.Signal, "signal", "s", "KILL", "Signal to send to the container")
flags.BoolVarP(&killCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
// killCmd kills one or more containers with a signal
@@ -52,10 +56,6 @@ func killCmd(c *cliconfig.KillValues) error {
killSignal uint = uint(syscall.SIGTERM)
)
- if err := checkAllAndLatest(&c.PodmanCommand); err != nil {
- return err
- }
-
rootless.SetSkipStorageSetup(true)
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
if err != nil {
diff --git a/cmd/podman/logs.go b/cmd/podman/logs.go
index 4cf3b7cb8..97d835d8f 100644
--- a/cmd/podman/logs.go
+++ b/cmd/podman/logs.go
@@ -46,6 +46,7 @@ func init() {
flags.SetInterspersed(false)
+ markFlagHiddenForRemoteClient("latest", flags)
}
func logsCmd(c *cliconfig.LogsValues) error {
diff --git a/cmd/podman/mount.go b/cmd/podman/mount.go
index ce7c22d60..f4a7bd5ea 100644
--- a/cmd/podman/mount.go
+++ b/cmd/podman/mount.go
@@ -34,6 +34,9 @@ var (
mountCommand.GlobalFlags = MainGlobalOpts
return mountCmd(&mountCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, true)
+ },
}
)
@@ -46,6 +49,7 @@ func init() {
flags.BoolVarP(&mountCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
flags.BoolVar(&mountCommand.NoTrunc, "notruncate", false, "Do not truncate output")
+ markFlagHiddenForRemoteClient("latest", flags)
}
// jsonMountPoint stores info about each container
diff --git a/cmd/podman/pod_inspect.go b/cmd/podman/pod_inspect.go
index f7731fc61..1f4d1a3dd 100644
--- a/cmd/podman/pod_inspect.go
+++ b/cmd/podman/pod_inspect.go
@@ -32,15 +32,13 @@ func init() {
flags := podInspectCommand.Flags()
flags.BoolVarP(&podInspectCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func podInspectCmd(c *cliconfig.PodInspectValues) error {
var (
pod *adapter.Pod
)
- if err := checkMutuallyExclusiveFlags(&c.PodmanCommand); err != nil {
- return err
- }
args := c.InputArgs
runtime, err := adapter.GetRuntime(&c.PodmanCommand)
if err != nil {
diff --git a/cmd/podman/pod_kill.go b/cmd/podman/pod_kill.go
index f6991a1c3..d0318b409 100644
--- a/cmd/podman/pod_kill.go
+++ b/cmd/podman/pod_kill.go
@@ -24,6 +24,9 @@ var (
podKillCommand.GlobalFlags = MainGlobalOpts
return podKillCmd(&podKillCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman pod kill podID
podman pod kill --signal TERM mywebserver
podman pod kill --latest`,
@@ -37,14 +40,11 @@ func init() {
flags.BoolVarP(&podKillCommand.All, "all", "a", false, "Kill all containers in all pods")
flags.BoolVarP(&podKillCommand.Latest, "latest", "l", false, "Act on the latest pod podman is aware of")
flags.StringVarP(&podKillCommand.Signal, "signal", "s", "KILL", "Signal to send to the containers in the pod")
+ markFlagHiddenForRemoteClient("latest", flags)
}
// podKillCmd kills one or more pods with a signal
func podKillCmd(c *cliconfig.PodKillValues) error {
- if err := checkMutuallyExclusiveFlags(&c.PodmanCommand); err != nil {
- return err
- }
-
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "could not get runtime")
diff --git a/cmd/podman/pod_pause.go b/cmd/podman/pod_pause.go
index ea2c80f7b..e01d73c9b 100644
--- a/cmd/podman/pod_pause.go
+++ b/cmd/podman/pod_pause.go
@@ -21,6 +21,9 @@ var (
podPauseCommand.GlobalFlags = MainGlobalOpts
return podPauseCmd(&podPauseCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman pod pause podID1 podID2
podman pod pause --latest
podman pod pause --all`,
@@ -33,13 +36,10 @@ func init() {
flags := podPauseCommand.Flags()
flags.BoolVarP(&podPauseCommand.All, "all", "a", false, "Pause all running pods")
flags.BoolVarP(&podPauseCommand.Latest, "latest", "l", false, "Act on the latest pod podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func podPauseCmd(c *cliconfig.PodPauseValues) error {
- if err := checkMutuallyExclusiveFlags(&c.PodmanCommand); err != nil {
- return err
- }
-
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "error creating libpod runtime")
diff --git a/cmd/podman/pod_ps.go b/cmd/podman/pod_ps.go
index 49af91a1e..85467b6ad 100644
--- a/cmd/podman/pod_ps.go
+++ b/cmd/podman/pod_ps.go
@@ -144,7 +144,7 @@ func init() {
flags.BoolVar(&podPsCommand.NoTrunc, "no-trunc", false, "Do not truncate pod and container IDs")
flags.BoolVarP(&podPsCommand.Quiet, "quiet", "q", false, "Print the numeric IDs of the pods only")
flags.StringVar(&podPsCommand.Sort, "sort", "created", "Sort output by created, id, name, or number")
-
+ markFlagHiddenForRemoteClient("latest", flags)
}
func podPsCmd(c *cliconfig.PodPsValues) error {
diff --git a/cmd/podman/pod_restart.go b/cmd/podman/pod_restart.go
index 2815af0c6..be54630db 100644
--- a/cmd/podman/pod_restart.go
+++ b/cmd/podman/pod_restart.go
@@ -22,6 +22,9 @@ var (
podRestartCommand.GlobalFlags = MainGlobalOpts
return podRestartCmd(&podRestartCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman pod restart podID1 podID2
podman pod restart --latest
podman pod restart --all`,
@@ -35,13 +38,10 @@ func init() {
flags.BoolVarP(&podRestartCommand.All, "all", "a", false, "Restart all running pods")
flags.BoolVarP(&podRestartCommand.Latest, "latest", "l", false, "Restart the latest pod podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func podRestartCmd(c *cliconfig.PodRestartValues) error {
- if err := checkMutuallyExclusiveFlags(&c.PodmanCommand); err != nil {
- return err
- }
-
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "could not get runtime")
diff --git a/cmd/podman/pod_rm.go b/cmd/podman/pod_rm.go
index b615f88c9..b552b9f42 100644
--- a/cmd/podman/pod_rm.go
+++ b/cmd/podman/pod_rm.go
@@ -26,6 +26,9 @@ If --force is specified, all containers will be stopped, then removed.
podRmCommand.GlobalFlags = MainGlobalOpts
return podRmCmd(&podRmCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman pod rm mywebserverpod
podman pod rm -f 860a4b23
podman pod rm -f -a`,
@@ -39,14 +42,11 @@ func init() {
flags.BoolVarP(&podRmCommand.All, "all", "a", false, "Remove all running pods")
flags.BoolVarP(&podRmCommand.Force, "force", "f", false, "Force removal of a running pod by first stopping all containers, then removing all containers in the pod. The default is false")
flags.BoolVarP(&podRmCommand.Latest, "latest", "l", false, "Remove the latest pod podman is aware of")
-
+ markFlagHiddenForRemoteClient("latest", flags)
}
// podRmCmd deletes pods
func podRmCmd(c *cliconfig.PodRmValues) error {
- if err := checkMutuallyExclusiveFlags(&c.PodmanCommand); err != nil {
- return err
- }
runtime, err := adapter.GetRuntime(&c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "could not get runtime")
diff --git a/cmd/podman/pod_start.go b/cmd/podman/pod_start.go
index d093c51cf..3bba5c2e9 100644
--- a/cmd/podman/pod_start.go
+++ b/cmd/podman/pod_start.go
@@ -26,6 +26,9 @@ var (
podStartCommand.GlobalFlags = MainGlobalOpts
return podStartCmd(&podStartCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman pod start podID
podman pod start --latest
podman pod start --all`,
@@ -38,13 +41,10 @@ func init() {
flags := podStartCommand.Flags()
flags.BoolVarP(&podStartCommand.All, "all", "a", false, "Start all pods")
flags.BoolVarP(&podStartCommand.Latest, "latest", "l", false, "Start the latest pod podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func podStartCmd(c *cliconfig.PodStartValues) error {
- if err := checkMutuallyExclusiveFlags(&c.PodmanCommand); err != nil {
- return err
- }
-
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "could not get runtime")
diff --git a/cmd/podman/pod_stats.go b/cmd/podman/pod_stats.go
index b1779532f..907d6a547 100644
--- a/cmd/podman/pod_stats.go
+++ b/cmd/podman/pod_stats.go
@@ -47,6 +47,7 @@ func init() {
flags.BoolVarP(&podStatsCommand.Latest, "latest", "l", false, "Provide stats on the latest pod podman is aware of")
flags.BoolVar(&podStatsCommand.NoStream, "no-stream", false, "Disable streaming stats and only pull the first result, default setting is false")
flags.BoolVar(&podStatsCommand.NoReset, "no-reset", false, "Disable resetting the screen between intervals")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func podStatsCmd(c *cliconfig.PodStatsValues) error {
diff --git a/cmd/podman/pod_stop.go b/cmd/podman/pod_stop.go
index a9237347e..52c92b521 100644
--- a/cmd/podman/pod_stop.go
+++ b/cmd/podman/pod_stop.go
@@ -27,6 +27,9 @@ var (
podStopCommand.GlobalFlags = MainGlobalOpts
return podStopCmd(&podStopCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman pod stop mywebserverpod
podman pod stop --latest
podman pod stop --timeout 0 490eb 3557fb`,
@@ -40,14 +43,11 @@ func init() {
flags.BoolVarP(&podStopCommand.All, "all", "a", false, "Stop all running pods")
flags.BoolVarP(&podStopCommand.Latest, "latest", "l", false, "Stop the latest pod podman is aware of")
flags.UintVarP(&podStopCommand.Timeout, "timeout", "t", 0, "Seconds to wait for pod stop before killing the container")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func podStopCmd(c *cliconfig.PodStopValues) error {
timeout := -1
- if err := checkMutuallyExclusiveFlags(&c.PodmanCommand); err != nil {
- return err
- }
-
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "could not get runtime")
diff --git a/cmd/podman/pod_unpause.go b/cmd/podman/pod_unpause.go
index 6c131b92c..35128e87b 100644
--- a/cmd/podman/pod_unpause.go
+++ b/cmd/podman/pod_unpause.go
@@ -22,6 +22,9 @@ var (
podUnpauseCommand.GlobalFlags = MainGlobalOpts
return podUnpauseCmd(&podUnpauseCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman pod unpause podID1 podID2
podman pod unpause --all
podman pod unpause --latest`,
@@ -34,13 +37,10 @@ func init() {
flags := podUnpauseCommand.Flags()
flags.BoolVarP(&podUnpauseCommand.All, "all", "a", false, "Unpause all running pods")
flags.BoolVarP(&podUnpauseCommand.Latest, "latest", "l", false, "Unpause the latest pod podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func podUnpauseCmd(c *cliconfig.PodUnpauseValues) error {
- if err := checkMutuallyExclusiveFlags(&c.PodmanCommand); err != nil {
- return err
- }
-
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "error creating libpod runtime")
diff --git a/cmd/podman/port.go b/cmd/podman/port.go
index 581371e4f..bcf372a51 100644
--- a/cmd/podman/port.go
+++ b/cmd/podman/port.go
@@ -28,6 +28,9 @@ var (
portCommand.GlobalFlags = MainGlobalOpts
return portCmd(&portCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, true)
+ },
Example: `podman port --all
podman port ctrID 80/tcp
podman port --latest 80`,
@@ -42,6 +45,7 @@ func init() {
flags.BoolVarP(&portCommand.All, "all", "a", false, "Display port information for all containers")
flags.BoolVarP(&portCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func portCmd(c *cliconfig.PortValues) error {
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index d7f0d9da0..9c165b836 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -191,6 +191,7 @@ func init() {
flags.StringVar(&psCommand.Sort, "sort", "created", "Sort output by command, created, id, image, names, runningfor, size, or status")
flags.BoolVar(&psCommand.Sync, "sync", false, "Sync container state with OCI runtime")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func psCmd(c *cliconfig.PsValues) error {
diff --git a/cmd/podman/restart.go b/cmd/podman/restart.go
index 97b689c02..58fb38874 100644
--- a/cmd/podman/restart.go
+++ b/cmd/podman/restart.go
@@ -26,6 +26,9 @@ var (
restartCommand.GlobalFlags = MainGlobalOpts
return restartCmd(&restartCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman restart ctrID
podman restart --latest
podman restart ctrID1 ctrID2`,
@@ -42,6 +45,7 @@ func init() {
flags.UintVarP(&restartCommand.Timeout, "timeout", "t", libpod.CtrRemoveTimeout, "Seconds to wait for stop before killing the container")
flags.UintVar(&restartCommand.Timeout, "time", libpod.CtrRemoveTimeout, "Seconds to wait for stop before killing the container")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func restartCmd(c *cliconfig.RestartValues) error {
diff --git a/cmd/podman/restore.go b/cmd/podman/restore.go
index 2911bbdd6..5f6e7b892 100644
--- a/cmd/podman/restore.go
+++ b/cmd/podman/restore.go
@@ -29,6 +29,9 @@ var (
restoreCommand.GlobalFlags = MainGlobalOpts
return restoreCmd(&restoreCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman container restore ctrID
podman container restore --latest
podman container restore --all`,
@@ -45,6 +48,7 @@ func init() {
// TODO: add ContainerStateCheckpointed
flags.BoolVar(&restoreCommand.TcpEstablished, "tcp-established", false, "Checkpoint a container with established TCP connections")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func restoreCmd(c *cliconfig.RestoreValues) error {
@@ -63,10 +67,6 @@ func restoreCmd(c *cliconfig.RestoreValues) error {
TCPEstablished: c.TcpEstablished,
}
- if err := checkAllAndLatest(&c.PodmanCommand); err != nil {
- return err
- }
-
containers, lastError := getAllOrLatestContainers(&c.PodmanCommand, runtime, libpod.ContainerStateExited, "checkpointed")
for _, ctr := range containers {
diff --git a/cmd/podman/rm.go b/cmd/podman/rm.go
index 2e5fe1dc0..01ed70f52 100644
--- a/cmd/podman/rm.go
+++ b/cmd/podman/rm.go
@@ -28,6 +28,9 @@ Running containers will not be removed without the -f option.
rmCommand.GlobalFlags = MainGlobalOpts
return rmCmd(&rmCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman rm imageID
podman rm mywebserver myflaskserver 860a4b23
podman rm --force --all`,
@@ -42,6 +45,7 @@ func init() {
flags.BoolVarP(&rmCommand.Force, "force", "f", false, "Force removal of a running container. The default is false")
flags.BoolVarP(&rmCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
flags.BoolVarP(&rmCommand.Volumes, "volumes", "v", false, "Remove the volumes associated with the container")
+ markFlagHiddenForRemoteClient("latest", flags)
}
// saveCmd saves the image to either docker-archive or oci
@@ -57,10 +61,6 @@ func rmCmd(c *cliconfig.RmValues) error {
}
defer runtime.Shutdown(false)
- if err := checkAllAndLatest(&c.PodmanCommand); err != nil {
- return err
- }
-
delContainers, err := getAllOrLatestContainers(&c.PodmanCommand, runtime, -1, "all")
if err != nil {
if c.Force && len(c.InputArgs) > 0 {
diff --git a/cmd/podman/save.go b/cmd/podman/save.go
index ba5209f34..ab421add6 100644
--- a/cmd/podman/save.go
+++ b/cmd/podman/save.go
@@ -1,20 +1,25 @@
package main
import (
- "os"
-
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/libpod/adapter"
+ "github.com/containers/libpod/pkg/util"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
+ "os"
+ "strings"
)
const (
ociManifestDir = "oci-dir"
+ ociArchive = "oci-archive"
v2s2ManifestDir = "docker-dir"
+ v2s2Archive = "docker-archive"
)
+var validFormats = []string{ociManifestDir, ociArchive, v2s2ManifestDir, v2s2Archive}
+
var (
saveCommand cliconfig.SaveValues
saveDescription = `
@@ -30,6 +35,16 @@ var (
saveCommand.GlobalFlags = MainGlobalOpts
return saveCmd(&saveCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ format, err := cmd.Flags().GetString("format")
+ if err != nil {
+ return err
+ }
+ if !util.StringInSlice(format, validFormats) {
+ return errors.Errorf("format value must be one of %s", strings.Join(validFormats, " "))
+ }
+ return nil
+ },
Example: `podman save --quiet -o myimage.tar imageID
podman save --format docker-dir -o ubuntu-dir ubuntu
podman save > alpine-all.tar alpine:latest`,
@@ -41,7 +56,7 @@ func init() {
saveCommand.SetUsageTemplate(UsageTemplate())
flags := saveCommand.Flags()
flags.BoolVar(&saveCommand.Compress, "compress", false, "Compress tarball image layers when saving to a directory using the 'dir' transport. (default is same compression type as source)")
- flags.StringVar(&saveCommand.Format, "format", "docker-archive", "Save image to oci-archive, oci-dir (directory with oci manifest type), docker-dir (directory with v2s2 manifest type)")
+ flags.StringVar(&saveCommand.Format, "format", v2s2Archive, "Save image to oci-archive, oci-dir (directory with oci manifest type), docker-archive, docker-dir (directory with v2s2 manifest type)")
flags.StringVarP(&saveCommand.Output, "output", "o", "/dev/stdout", "Write to a file, default is STDOUT")
flags.BoolVarP(&saveCommand.Quiet, "quiet", "q", false, "Suppress the output")
}
diff --git a/cmd/podman/start.go b/cmd/podman/start.go
index db8abae83..c645a35c4 100644
--- a/cmd/podman/start.go
+++ b/cmd/podman/start.go
@@ -44,6 +44,7 @@ func init() {
flags.BoolVarP(&startCommand.Interactive, "interactive", "i", false, "Keep STDIN open even if not attached")
flags.BoolVarP(&startCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
flags.BoolVar(&startCommand.SigProxy, "sig-proxy", true, "Proxy received signals to the process (default true if attaching, false otherwise)")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func startCmd(c *cliconfig.StartValues) error {
diff --git a/cmd/podman/stats.go b/cmd/podman/stats.go
index 642e54f49..2bbcd0a17 100644
--- a/cmd/podman/stats.go
+++ b/cmd/podman/stats.go
@@ -41,6 +41,9 @@ var (
statsCommand.GlobalFlags = MainGlobalOpts
return statsCmd(&statsCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman stats --all --no-stream
podman stats ctrID
podman stats --no-stream --format "table {{.ID}} {{.Name}} {{.MemUsage}}" ctrID`,
@@ -56,6 +59,7 @@ func init() {
flags.BoolVarP(&statsCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
flags.BoolVar(&statsCommand.NoReset, "no-reset", false, "Disable resetting the screen between intervals")
flags.BoolVar(&statsCommand.NoStream, "no-stream", false, "Disable streaming stats and only pull the first result, default setting is false")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func statsCmd(c *cliconfig.StatsValues) error {
diff --git a/cmd/podman/stop.go b/cmd/podman/stop.go
index 94fdf321e..67c15b2a8 100644
--- a/cmd/podman/stop.go
+++ b/cmd/podman/stop.go
@@ -32,6 +32,9 @@ var (
stopCommand.GlobalFlags = MainGlobalOpts
return stopCmd(&stopCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, false)
+ },
Example: `podman stop ctrID
podman stop --latest
podman stop --timeout 2 mywebserver 6e534f14da9d`,
@@ -46,6 +49,7 @@ func init() {
flags.BoolVarP(&stopCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
flags.UintVar(&stopCommand.Timeout, "time", libpod.CtrRemoveTimeout, "Seconds to wait for stop before killing the container")
flags.UintVarP(&stopCommand.Timeout, "timeout", "t", libpod.CtrRemoveTimeout, "Seconds to wait for stop before killing the container")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func stopCmd(c *cliconfig.StopValues) error {
@@ -54,10 +58,6 @@ func stopCmd(c *cliconfig.StopValues) error {
defer span.Finish()
}
- if err := checkAllAndLatest(&c.PodmanCommand); err != nil {
- return err
- }
-
rootless.SetSkipStorageSetup(true)
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
if err != nil {
diff --git a/cmd/podman/top.go b/cmd/podman/top.go
index d85e1be53..36d6bb6b4 100644
--- a/cmd/podman/top.go
+++ b/cmd/podman/top.go
@@ -55,6 +55,7 @@ func init() {
flags.BoolVar(&topCommand.ListDescriptors, "list-descriptors", false, "")
flags.MarkHidden("list-descriptors")
flags.BoolVarP(&topCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func topCmd(c *cliconfig.TopValues) error {
diff --git a/cmd/podman/umount.go b/cmd/podman/umount.go
index afa0e86db..6d9009388 100644
--- a/cmd/podman/umount.go
+++ b/cmd/podman/umount.go
@@ -31,6 +31,9 @@ An unmount can be forced with the --force flag.
umountCommand.GlobalFlags = MainGlobalOpts
return umountCmd(&umountCommand)
},
+ Args: func(cmd *cobra.Command, args []string) error {
+ return checkAllAndLatest(cmd, args, true)
+ },
Example: `podman umount ctrID
podman umount ctrID1 ctrID2 ctrID3
podman umount --all`,
@@ -44,6 +47,7 @@ func init() {
flags.BoolVarP(&umountCommand.All, "all", "a", false, "Umount all of the currently mounted containers")
flags.BoolVarP(&umountCommand.Force, "force", "f", false, "Force the complete umount all of the currently mounted containers")
flags.BoolVarP(&umountCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func umountCmd(c *cliconfig.UmountValues) error {
@@ -55,9 +59,6 @@ func umountCmd(c *cliconfig.UmountValues) error {
force := c.Force
umountAll := c.All
- if err := checkAllAndLatest(&c.PodmanCommand); err != nil {
- return err
- }
containers, err := getAllOrLatestContainers(&c.PodmanCommand, runtime, -1, "all")
if err != nil {
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go
index c76e7f2a4..0fbea417b 100644
--- a/cmd/podman/utils.go
+++ b/cmd/podman/utils.go
@@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
+ "github.com/spf13/pflag"
"os"
gosignal "os/signal"
@@ -158,13 +159,6 @@ func (f *RawTtyFormatter) Format(entry *logrus.Entry) ([]byte, error) {
return bytes, err
}
-func checkMutuallyExclusiveFlags(c *cliconfig.PodmanCommand) error {
- if err := checkAllAndLatest(c); err != nil {
- return err
- }
- return nil
-}
-
// For pod commands that have a latest and all flag, getPodsFromContext gets
// pods the user specifies. If there's an error before getting pods, the pods slice
// will be empty and error will be not nil. If an error occured after, the pod slice
@@ -251,3 +245,11 @@ func printParallelOutput(m map[string]error, errCount int) error {
}
return lastError
}
+
+// markFlagHiddenForRemoteClient makes the flag not appear as part of the CLI
+// on the remote-client
+func markFlagHiddenForRemoteClient(flagName string, flags *pflag.FlagSet) {
+ if remoteclient {
+ flags.MarkHidden(flagName)
+ }
+}
diff --git a/cmd/podman/wait.go b/cmd/podman/wait.go
index c6e6240f3..9df7cdbae 100644
--- a/cmd/podman/wait.go
+++ b/cmd/podman/wait.go
@@ -40,6 +40,7 @@ func init() {
flags := waitCommand.Flags()
flags.UintVarP(&waitCommand.Interval, "interval", "i", 250, "Milliseconds to wait before polling for completion")
flags.BoolVarP(&waitCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
+ markFlagHiddenForRemoteClient("latest", flags)
}
func waitCmd(c *cliconfig.WaitValues) error {
diff --git a/docs/podman-attach.1.md b/docs/podman-attach.1.md
index 4322ca2be..ceb945a0e 100644
--- a/docs/podman-attach.1.md
+++ b/docs/podman-attach.1.md
@@ -24,6 +24,8 @@ ctrl-[value] where [value] is one of: a-z, @, ^, [, , or _.
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--no-stdin**
Do not attach STDIN. The default is false.
diff --git a/docs/podman-container-checkpoint.1.md b/docs/podman-container-checkpoint.1.md
index 94e52dc78..666dbbb80 100644
--- a/docs/podman-container-checkpoint.1.md
+++ b/docs/podman-container-checkpoint.1.md
@@ -25,6 +25,8 @@ Checkpoint all running containers.
Instead of providing the container name or ID, checkpoint the last created container.
+The latest option is not supported on the remote client.
+
**--leave-running, -R**
Leave the container running after checkpointing instead of stopping it.
diff --git a/docs/podman-container-cleanup.1.md b/docs/podman-container-cleanup.1.md
index 2819d1138..e375c12ec 100644
--- a/docs/podman-container-cleanup.1.md
+++ b/docs/podman-container-cleanup.1.md
@@ -19,6 +19,9 @@ Cleanup all containers.
**--latest, -l**
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+
+The latest option is not supported on the remote client.
+
## EXAMPLE
`podman container cleanup mywebserver`
diff --git a/docs/podman-container-restore.1.md b/docs/podman-container-restore.1.md
index 44219f3ef..e47d585cc 100644
--- a/docs/podman-container-restore.1.md
+++ b/docs/podman-container-restore.1.md
@@ -32,6 +32,8 @@ Restore all checkpointed containers.
Instead of providing the container name or ID, restore the last created container.
+The latest option is not supported on the remote client.
+
**--tcp-established**
Restore a container with established TCP connections. If the checkpoint image
diff --git a/docs/podman-diff.1.md b/docs/podman-diff.1.md
index dd5f0edcf..8837b744f 100644
--- a/docs/podman-diff.1.md
+++ b/docs/podman-diff.1.md
@@ -15,6 +15,12 @@ Displays changes on a container or image's filesystem. The container or image w
Alter the output into a different format. The only valid format for diff is `json`.
+**--latest, -l**
+
+Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
+to run containers such as CRI-O, the last started container could be from either of those methods.
+
+The latest option is not supported on the remote client.
## EXAMPLE
diff --git a/docs/podman-exec.1.md b/docs/podman-exec.1.md
index 6f464a8f2..14088b468 100644
--- a/docs/podman-exec.1.md
+++ b/docs/podman-exec.1.md
@@ -24,6 +24,8 @@ Not supported. All exec commands are interactive by default.
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--privileged**
Give the process extended Linux capabilities when running the command in container.
diff --git a/docs/podman-inspect.1.md b/docs/podman-inspect.1.md
index b01bc0f4e..5748f29f4 100644
--- a/docs/podman-inspect.1.md
+++ b/docs/podman-inspect.1.md
@@ -27,6 +27,8 @@ The keys of the returned JSON can be used as the values for the --format flag (s
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--size, -s**
Display the total file size if the type is a container
diff --git a/docs/podman-kill.1.md b/docs/podman-kill.1.md
index 85f68a73d..1c14b71d5 100644
--- a/docs/podman-kill.1.md
+++ b/docs/podman-kill.1.md
@@ -19,6 +19,8 @@ Signal all running containers. This does not include paused containers.
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--signal, s**
Signal to send to the container. For more information on Linux signals, refer to *man signal(7)*.
diff --git a/docs/podman-load.1.md b/docs/podman-load.1.md
index eca7ecb2e..8b6501a5c 100644
--- a/docs/podman-load.1.md
+++ b/docs/podman-load.1.md
@@ -22,7 +22,9 @@ Note: `:` is a restricted character and cannot be part of the file name.
**--input, -i**
-Read from archive file, default is STDIN
+Read from archive file, default is STDIN.
+
+The remote client requires the use of this option.
**--quiet, -q**
diff --git a/docs/podman-logs.1.md b/docs/podman-logs.1.md
index 6b37aed9e..bc02df954 100644
--- a/docs/podman-logs.1.md
+++ b/docs/podman-logs.1.md
@@ -17,6 +17,13 @@ any logs at the time you execute podman logs
Follow log output. Default is false
+**--latest, -l**
+
+Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
+to run containers such as CRI-O, the last started container could be from either of those methods.
+
+The latest option is not supported on the remote client.
+
**--since=TIMESTAMP**
Show logs since TIMESTAMP. The --since option can be Unix timestamps, date formatted timestamps, or Go duration
diff --git a/docs/podman-mount.1.md b/docs/podman-mount.1.md
index 2cccf5ee0..e244e5daf 100644
--- a/docs/podman-mount.1.md
+++ b/docs/podman-mount.1.md
@@ -33,6 +33,8 @@ Instead of providing the container name or ID, use the last created container.
If you use methods other than Podman to run containers such as CRI-O, the last
started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--notruncate**
Do not truncate IDs in output.
diff --git a/docs/podman-pod-inspect.1.md b/docs/podman-pod-inspect.1.md
index b8fb143ba..a4e6a5559 100644
--- a/docs/podman-pod-inspect.1.md
+++ b/docs/podman-pod-inspect.1.md
@@ -16,6 +16,7 @@ that belong to the pod.
Instead of providing the pod name or ID, use the last created pod. If you use methods other than Podman
to run pods such as CRI-O, the last started pod could be from either of those methods.
+The latest option is not supported on the remote client.
## EXAMPLE
```
diff --git a/docs/podman-pod-kill.1.md b/docs/podman-pod-kill.1.md
index 4376c2d29..2a863d3d9 100644
--- a/docs/podman-pod-kill.1.md
+++ b/docs/podman-pod-kill.1.md
@@ -19,6 +19,8 @@ Sends signal to all containers associated with a pod.
Instead of providing the pod name or ID, use the last created pod. If you use methods other than Podman
to run pods such as CRI-O, the last started pod could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--signal, s**
Signal to send to the containers in the pod. For more information on Linux signals, refer to *man signal(7)*.
diff --git a/docs/podman-pod-pause.1.md b/docs/podman-pod-pause.1.md
index 32c5b927e..418a9ee2a 100644
--- a/docs/podman-pod-pause.1.md
+++ b/docs/podman-pod-pause.1.md
@@ -19,6 +19,8 @@ Pause all pods.
Instead of providing the pod name or ID, pause the last created pod.
+The latest option is not supported on the remote client.
+
## EXAMPLE
podman pod pause mywebserverpod
diff --git a/docs/podman-pod-ps.1.md b/docs/podman-pod-ps.1.md
index 24b343438..ee215154a 100644
--- a/docs/podman-pod-ps.1.md
+++ b/docs/podman-pod-ps.1.md
@@ -42,6 +42,8 @@ Includes the container statuses in the container info field
Show the latest pod created (all states)
+The latest option is not supported on the remote client.
+
**--no-trunc**
Display the extended information
diff --git a/docs/podman-pod-restart.1.md b/docs/podman-pod-restart.1.md
index 1cccd3382..cd6e5c8ce 100644
--- a/docs/podman-pod-restart.1.md
+++ b/docs/podman-pod-restart.1.md
@@ -22,6 +22,8 @@ Restarts all pods
Instead of providing the pod name or ID, restart the last created pod.
+The latest option is not supported on the remote client.
+
## EXAMPLE
```
diff --git a/docs/podman-pod-rm.1.md b/docs/podman-pod-rm.1.md
index 7a300c152..aa26a1bbb 100644
--- a/docs/podman-pod-rm.1.md
+++ b/docs/podman-pod-rm.1.md
@@ -19,6 +19,8 @@ Remove all pods. Can be used in conjunction with \-f as well.
Instead of providing the pod name or ID, remove the last created pod.
+The latest option is not supported on the remote client.
+
**--force, f**
Stop running containers and delete all stopped containers before removal of pod.
diff --git a/docs/podman-pod-start.1.md b/docs/podman-pod-start.1.md
index 253bb5f53..27e40740f 100644
--- a/docs/podman-pod-start.1.md
+++ b/docs/podman-pod-start.1.md
@@ -20,6 +20,8 @@ Starts all pods
Instead of providing the pod name or ID, start the last created pod.
+The latest option is not supported on the remote client.
+
## EXAMPLE
podman pod start mywebserverpod
diff --git a/docs/podman-pod-stop.1.md b/docs/podman-pod-stop.1.md
index 7544f8bf7..338e04d67 100644
--- a/docs/podman-pod-stop.1.md
+++ b/docs/podman-pod-stop.1.md
@@ -19,6 +19,8 @@ Stops all pods
Instead of providing the pod name or ID, stop the last created pod.
+The latest option is not supported on the remote client.
+
**--timeout, --time, t**
Timeout to wait before forcibly stopping the containers in the pod.
diff --git a/docs/podman-pod-top.1.md b/docs/podman-pod-top.1.md
index 0b330eb03..a77ca2b37 100644
--- a/docs/podman-pod-top.1.md
+++ b/docs/podman-pod-top.1.md
@@ -19,6 +19,8 @@ Display the running process of containers in a pod. The *format-descriptors* are
Instead of providing the pod name or ID, use the last created pod.
+The latest option is not supported on the remote client.
+
## FORMAT DESCRIPTORS
The following descriptors are supported in addition to the AIX format descriptors mentioned in ps (1):
diff --git a/docs/podman-pod-unpause.1.md b/docs/podman-pod-unpause.1.md
index 643544ef1..1004e09f9 100644
--- a/docs/podman-pod-unpause.1.md
+++ b/docs/podman-pod-unpause.1.md
@@ -19,6 +19,8 @@ Unpause all pods.
Instead of providing the pod name or ID, unpause the last created pod.
+The latest option is not supported on the remote client.
+
## EXAMPLE
podman pod unpause mywebserverpod
diff --git a/docs/podman-port.1.md b/docs/podman-port.1.md
index 25a8eceb5..020a25d32 100644
--- a/docs/podman-port.1.md
+++ b/docs/podman-port.1.md
@@ -21,6 +21,8 @@ or private ports/protocols as filters.
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
## EXAMPLE
List all port mappings
diff --git a/docs/podman-ps.1.md b/docs/podman-ps.1.md
index 8b86703d8..b8b1c3d62 100644
--- a/docs/podman-ps.1.md
+++ b/docs/podman-ps.1.md
@@ -75,6 +75,8 @@ Print the n last created containers (all states)
Show the latest container created (all states)
+The latest option is not supported on the remote client.
+
**--namespace, --ns**
Display namespace information
diff --git a/docs/podman-restart.1.md b/docs/podman-restart.1.md
index 875afa385..dd28e34c7 100644
--- a/docs/podman-restart.1.md
+++ b/docs/podman-restart.1.md
@@ -19,6 +19,8 @@ Restart all containers regardless of their current state.
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--running**
Restart all containers that are already in the *running* state.
diff --git a/docs/podman-rm.1.md b/docs/podman-rm.1.md
index f4513c2be..10ebe97f9 100644
--- a/docs/podman-rm.1.md
+++ b/docs/podman-rm.1.md
@@ -26,6 +26,8 @@ Containers could have been created by a different container engine.
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--volumes, -v**
Remove the volumes associated with the container. (Not yet implemented)
diff --git a/docs/podman-start.1.md b/docs/podman-start.1.md
index 786936721..b0167003e 100644
--- a/docs/podman-start.1.md
+++ b/docs/podman-start.1.md
@@ -33,6 +33,7 @@ Attach container's STDIN. The default is false.
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
**--sig-proxy**=*true*|*false*
diff --git a/docs/podman-stats.1.md b/docs/podman-stats.1.md
index d0b56b2e6..97a9be961 100644
--- a/docs/podman-stats.1.md
+++ b/docs/podman-stats.1.md
@@ -20,6 +20,8 @@ Show all containers. Only running containers are shown by default
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--no-reset**
Do not clear the terminal/screen in between reporting intervals
diff --git a/docs/podman-stop.1.md b/docs/podman-stop.1.md
index e36265d5e..2016a7301 100644
--- a/docs/podman-stop.1.md
+++ b/docs/podman-stop.1.md
@@ -24,6 +24,8 @@ Stop all running containers. This does not include paused containers.
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
**--timeout, --time, t**
Timeout to wait before forcibly stopping the container
diff --git a/docs/podman-top.1.md b/docs/podman-top.1.md
index 7782a3f29..52d1238ef 100644
--- a/docs/podman-top.1.md
+++ b/docs/podman-top.1.md
@@ -20,6 +20,8 @@ Display the running process of the container. The *format-descriptors* are ps (1
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
## FORMAT DESCRIPTORS
The following descriptors are supported in addition to the AIX format descriptors mentioned in ps (1):
diff --git a/docs/podman-umount.1.md b/docs/podman-umount.1.md
index cceb63019..795f0402d 100644
--- a/docs/podman-umount.1.md
+++ b/docs/podman-umount.1.md
@@ -35,6 +35,8 @@ Instead of providing the container name or ID, use the last created container.
If you use methods other than Podman to run containers such as CRI-O, the last
started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
## EXAMPLE
podman umount containerID
diff --git a/docs/podman-wait.1.md b/docs/podman-wait.1.md
index dd5dc7907..672316eef 100644
--- a/docs/podman-wait.1.md
+++ b/docs/podman-wait.1.md
@@ -22,9 +22,11 @@ After the container stops, the container's return code is printed.
**--latest, -l**
- Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
+Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods.
+The latest option is not supported on the remote client.
+
## EXAMPLES
```