diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-18 15:42:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 15:42:06 -0500 |
commit | 094b11cbcb528a7d120c31402a1bcd9c82d84938 (patch) | |
tree | 3ce00f13dda775d979a093658f26cea4122646d9 /cmd/podman | |
parent | 62212dbf490d736ad06523a92345a480e4972dab (diff) | |
parent | c0e07234631cfcea1d6724c05606964a4d833f39 (diff) | |
download | podman-094b11cbcb528a7d120c31402a1bcd9c82d84938.tar.gz podman-094b11cbcb528a7d120c31402a1bcd9c82d84938.tar.bz2 podman-094b11cbcb528a7d120c31402a1bcd9c82d84938.zip |
Merge pull request #12908 from Luap99/network-conf-dir
rename --cni-config-dir to --network-config-dir
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/root.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 7989f9cd5..be6eacfc2 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -85,6 +85,14 @@ func init() { ) rootFlags(rootCmd, registry.PodmanConfig()) + + // backwards compat still allow --cni-config-dir + rootCmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { + if name == "cni-config-dir" { + name = "network-config-dir" + } + return pflag.NormalizedName(name) + }) rootCmd.SetUsageTemplate(usageTemplate) } @@ -371,9 +379,9 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) { pFlags.StringVar(&cfg.Engine.NetworkCmdPath, networkCmdPathFlagName, cfg.Engine.NetworkCmdPath, "Path to the command for configuring the network") _ = cmd.RegisterFlagCompletionFunc(networkCmdPathFlagName, completion.AutocompleteDefault) - cniConfigDirFlagName := "cni-config-dir" - pFlags.StringVar(&cfg.Network.NetworkConfigDir, cniConfigDirFlagName, cfg.Network.NetworkConfigDir, "Path of the configuration directory for CNI networks") - _ = cmd.RegisterFlagCompletionFunc(cniConfigDirFlagName, completion.AutocompleteDefault) + networkConfigDirFlagName := "network-config-dir" + pFlags.StringVar(&cfg.Network.NetworkConfigDir, networkConfigDirFlagName, cfg.Network.NetworkConfigDir, "Path of the configuration directory for networks") + _ = cmd.RegisterFlagCompletionFunc(networkConfigDirFlagName, completion.AutocompleteDefault) pFlags.StringVar(&cfg.Containers.DefaultMountsFile, "default-mounts-file", cfg.Containers.DefaultMountsFile, "Path to default mounts file") |