diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-15 16:11:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-15 16:11:14 -0400 |
commit | 5f41ffdd194a828625b3bb6ec55ed87d2830fe58 (patch) | |
tree | a625a713dc2205ac80122883f3532fc31bfb8fe2 /cmd/podman/common/completion.go | |
parent | 505c9718cc717433780be8240250a247253ba34f (diff) | |
parent | 5e8309464aea005fbc1604c304a94760aff4ee9a (diff) | |
download | podman-5f41ffdd194a828625b3bb6ec55ed87d2830fe58.tar.gz podman-5f41ffdd194a828625b3bb6ec55ed87d2830fe58.tar.bz2 podman-5f41ffdd194a828625b3bb6ec55ed87d2830fe58.zip |
Merge pull request #11322 from Luap99/network-libpod
Wire network interface into libpod
Diffstat (limited to 'cmd/podman/common/completion.go')
-rw-r--r-- | cmd/podman/common/completion.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go index e925fb4f1..193f09e85 100644 --- a/cmd/podman/common/completion.go +++ b/cmd/podman/common/completion.go @@ -11,6 +11,7 @@ import ( "github.com/containers/image/v5/pkg/sysregistriesv2" "github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/libpod/network/types" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/network" "github.com/containers/podman/v3/pkg/rootless" @@ -1108,9 +1109,9 @@ func AutocompleteManifestFormat(cmd *cobra.Command, args []string, toComplete st } // AutocompleteNetworkDriver - Autocomplete network driver option. -// -> "bridge" +// -> "bridge", "macvlan" func AutocompleteNetworkDriver(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - drivers := []string{"bridge"} + drivers := []string{types.BridgeNetworkDriver, types.MacVLANNetworkDriver} return drivers, cobra.ShellCompDirectiveNoFileComp } @@ -1252,16 +1253,13 @@ func AutocompletePruneFilters(cmd *cobra.Command, args []string, toComplete stri // AutocompleteNetworkFilters - Autocomplete network ls --filter options. func AutocompleteNetworkFilters(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { kv := keyValueCompletion{ - "name=": func(s string) ([]string, cobra.ShellCompDirective) { return getNetworks(cmd, s, completeNames) }, - "id=": func(s string) ([]string, cobra.ShellCompDirective) { return getNetworks(cmd, s, completeIDs) }, - "plugin=": func(_ string) ([]string, cobra.ShellCompDirective) { - return []string{"bridge", "portmap", - "firewall", "tuning", "dnsname", "macvlan"}, cobra.ShellCompDirectiveNoFileComp - }, + "name=": func(s string) ([]string, cobra.ShellCompDirective) { return getNetworks(cmd, s, completeNames) }, + "id=": func(s string) ([]string, cobra.ShellCompDirective) { return getNetworks(cmd, s, completeIDs) }, "label=": nil, "driver=": func(_ string) ([]string, cobra.ShellCompDirective) { - return []string{"bridge"}, cobra.ShellCompDirectiveNoFileComp + return []string{types.BridgeNetworkDriver, types.MacVLANNetworkDriver}, cobra.ShellCompDirectiveNoFileComp }, + "until=": nil, } return completeKeyValues(toComplete, kv) } |