summaryrefslogtreecommitdiff
path: root/cmd/podman/validate
diff options
context:
space:
mode:
authorKarthik Elango <kelango@redhat.com>2022-06-28 15:31:20 -0400
committerMatthew Heon <matthew.heon@pm.me>2022-07-26 13:25:36 -0400
commit6d84a9952f1e5be1a187bcc6d9bbc2532331cfc8 (patch)
tree4219ba61a3cf8920dcde4fa1fe715ddd319932ab /cmd/podman/validate
parenta78be890ee0098c6a6809b562c4806da8fe344b5 (diff)
downloadpodman-6d84a9952f1e5be1a187bcc6d9bbc2532331cfc8.tar.gz
podman-6d84a9952f1e5be1a187bcc6d9bbc2532331cfc8.tar.bz2
podman-6d84a9952f1e5be1a187bcc6d9bbc2532331cfc8.zip
Podman stop --filter flag
Filter flag is added for podman stop and podman --remote stop. Filtering logic is implemented in getContainersAndInputByContext(). Start filtering can be manipulated to use this logic as well to limit redundancy. Signed-off-by: Karthik Elango <kelango@redhat.com>
Diffstat (limited to 'cmd/podman/validate')
-rw-r--r--cmd/podman/validate/args.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/podman/validate/args.go b/cmd/podman/validate/args.go
index 39eedca64..6d212665d 100644
--- a/cmd/podman/validate/args.go
+++ b/cmd/podman/validate/args.go
@@ -86,6 +86,13 @@ func CheckAllLatestAndIDFile(c *cobra.Command, args []string, ignoreArgLen bool,
specifiedIDFile = true
}
+ if c.Flags().Changed("filter") {
+ if argLen > 0 {
+ return errors.New("--filter takes no arguments")
+ }
+ return nil
+ }
+
if specifiedIDFile && (specifiedAll || specifiedLatest) {
return fmt.Errorf("--all, --latest, and --%s cannot be used together", idFileFlag)
} else if specifiedAll && specifiedLatest {