summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-11 19:12:43 +0100
committerGitHub <noreply@github.com>2021-11-11 19:12:43 +0100
commit375ff223f430301edf25ef5a5f03a1ae1e029bef (patch)
tree96993f98fa27d39a93589a93179e7c914746b876 /cmd
parentd5b411c484f9e45c71ad3552b796bd3343ec7a0c (diff)
parent3af19917a1666fc3f29d98f7f0b937eb488f706c (diff)
downloadpodman-375ff223f430301edf25ef5a5f03a1ae1e029bef.tar.gz
podman-375ff223f430301edf25ef5a5f03a1ae1e029bef.tar.bz2
podman-375ff223f430301edf25ef5a5f03a1ae1e029bef.zip
Merge pull request #12131 from Luap99/netavark-interface
Netavark interface
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/completion.go7
-rw-r--r--cmd/podman/root.go5
2 files changed, 12 insertions, 0 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go
index ea453a331..4cb29383a 100644
--- a/cmd/podman/common/completion.go
+++ b/cmd/podman/common/completion.go
@@ -1163,6 +1163,13 @@ func AutocompleteEventBackend(cmd *cobra.Command, args []string, toComplete stri
return types, cobra.ShellCompDirectiveNoFileComp
}
+// AutocompleteNetworkBackend - Autocomplete network backend options.
+// -> "cni", "netavark"
+func AutocompleteNetworkBackend(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
+ types := []string{"cni", "netavark"}
+ return types, cobra.ShellCompDirectiveNoFileComp
+}
+
// AutocompleteLogLevel - Autocomplete log level options.
// -> "trace", "debug", "info", "warn", "error", "fatal", "panic"
func AutocompleteLogLevel(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 6da34050e..418a70e1e 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -357,6 +357,11 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) {
pFlags.StringVar(&cfg.Engine.Namespace, namespaceFlagName, cfg.Engine.Namespace, "Set the libpod namespace, used to create separate views of the containers and pods on the system")
_ = cmd.RegisterFlagCompletionFunc(namespaceFlagName, completion.AutocompleteNone)
+ networkBackendFlagName := "network-backend"
+ pFlags.StringVar(&cfg.Network.NetworkBackend, networkBackendFlagName, cfg.Network.NetworkBackend, `Network backend to use ("cni"|"netavark")`)
+ _ = cmd.RegisterFlagCompletionFunc(networkBackendFlagName, common.AutocompleteNetworkBackend)
+ pFlags.MarkHidden(networkBackendFlagName)
+
rootFlagName := "root"
pFlags.StringVar(&cfg.Engine.StaticDir, rootFlagName, "", "Path to the root directory in which data, including images, is stored")
_ = cmd.RegisterFlagCompletionFunc(rootFlagName, completion.AutocompleteDefault)