summaryrefslogtreecommitdiff
path: root/cmd/podman/validate
diff options
context:
space:
mode:
authorKarthik Elango <kelango@redhat.com>2022-06-28 15:31:20 -0400
committerKarthik Elango <kelango@redhat.com>2022-07-14 13:18:53 -0400
commita2f6cc74e72edf0b7045c8410ed3f45489999e2b (patch)
tree7424569f997630623d4290ace20ccf63cf743897 /cmd/podman/validate
parent3637d55191be2e9a5b9e13f8f62db4c27d188741 (diff)
downloadpodman-a2f6cc74e72edf0b7045c8410ed3f45489999e2b.tar.gz
podman-a2f6cc74e72edf0b7045c8410ed3f45489999e2b.tar.bz2
podman-a2f6cc74e72edf0b7045c8410ed3f45489999e2b.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 {