aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-01-18 16:17:53 +0100
committerPaul Holzinger <pholzing@redhat.com>2022-01-18 19:28:25 +0100
commitc0e07234631cfcea1d6724c05606964a4d833f39 (patch)
tree57c80b1ff2804f26a0546117b01c30ffbadcbc1c /cmd
parent55ad6188b067ba6594819c318dd2ae92dea2f27e (diff)
downloadpodman-c0e07234631cfcea1d6724c05606964a4d833f39.tar.gz
podman-c0e07234631cfcea1d6724c05606964a4d833f39.tar.bz2
podman-c0e07234631cfcea1d6724c05606964a4d833f39.zip
rename --cni-config-dir to --network-config-dir
Since this option will also be used for netavark we should rename it to something more generic. It is important that --cni-config-dir still works otherwise we could break existing container cleanup commands. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/root.go14
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")