diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-01-09 15:54:07 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-01-09 17:03:32 +0100 |
commit | 1242e7b7a612b1dcae0e09a7fd10e266d34cf9e2 (patch) | |
tree | e50592f434cfbae3935ea8973fdc6e1b76f6b94e /cmd | |
parent | 49db79e735acd2c693762eaff62680cd9a8cb60b (diff) | |
download | podman-1242e7b7a612b1dcae0e09a7fd10e266d34cf9e2.tar.gz podman-1242e7b7a612b1dcae0e09a7fd10e266d34cf9e2.tar.bz2 podman-1242e7b7a612b1dcae0e09a7fd10e266d34cf9e2.zip |
Add network filter for podman ps and pod ps
Allow to filter on the network name or full id.
For pod ps it will filter on the infra container networks.
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/common/completion.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go index 83fe0723c..d01842998 100644 --- a/cmd/podman/common/completion.go +++ b/cmd/podman/common/completion.go @@ -982,9 +982,10 @@ func AutocompletePsFilters(cmd *cobra.Command, args []string, toComplete string) return []string{define.HealthCheckHealthy, define.HealthCheckUnhealthy}, cobra.ShellCompDirectiveNoFileComp }, - "label=": nil, - "exited=": nil, - "until=": nil, + "network=": func(s string) ([]string, cobra.ShellCompDirective) { return getNetworks(cmd, s) }, + "label=": nil, + "exited=": nil, + "until=": nil, } return completeKeyValues(toComplete, kv) } @@ -1004,7 +1005,8 @@ func AutocompletePodPsFilters(cmd *cobra.Command, args []string, toComplete stri "ctr-status=": func(_ string) ([]string, cobra.ShellCompDirective) { return containerStatuses, cobra.ShellCompDirectiveNoFileComp }, - "label=": nil, + "network=": func(s string) ([]string, cobra.ShellCompDirective) { return getNetworks(cmd, s) }, + "label=": nil, } return completeKeyValues(toComplete, kv) } |