From 4ac80bdaec4cbc06ff549f676db7974d47cd0476 Mon Sep 17 00:00:00 2001 From: Pablo Caderno Date: Thu, 1 Oct 2020 18:21:54 +1000 Subject: [PATCH] Added deprecation warning for --network-plugin=cni Signed-off-by: Pablo Caderno --- cmd/minikube/cmd/start_flags.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index 4323b69d141f..c36a0b16f777 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -276,6 +276,15 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k glog.Errorf("Found deprecated --enable-default-cni flag, setting --cni=bridge") chosenCNI = "bridge" } + // networkPlugin cni deprecation warning + chosenNetworkPlugin := viper.GetString(networkPlugin) + if chosenNetworkPlugin == "cni" { + glog.Errorf("Found deprecated --network-plugin=cni flag (new flag: --cni), setting --cni=auto if not already set") + if chosenCNI == "" { + chosenCNI = "auto" + } + chosenNetworkPlugin = "" + } cc = config.ClusterConfig{ Name: ClusterFlagValue(), @@ -321,7 +330,7 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k FeatureGates: viper.GetString(featureGates), ContainerRuntime: viper.GetString(containerRuntime), CRISocket: viper.GetString(criSocket), - NetworkPlugin: viper.GetString(networkPlugin), + NetworkPlugin: chosenNetworkPlugin, ServiceCIDR: viper.GetString(serviceCIDR), ImageRepository: repository, ExtraOptions: config.ExtraOptions,