From 1d85d6e12303afc77c6df2bc1885f4d9348dffb4 Mon Sep 17 00:00:00 2001 From: Pablo Caderno Date: Thu, 1 Oct 2020 18:21:54 +1000 Subject: [PATCH] Add warning for --network-plugin=cni (CNI has to be provided, see --cni) Signed-off-by: Pablo Caderno --- cmd/minikube/cmd/start_flags.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index 4323b69d141f..11afeacf88b3 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -276,6 +276,11 @@ 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" { + out.WarningT("With --network-plugin=cni, you will need to provide your own CNI. See --cni flag as a user-friendly alternative") + } cc = config.ClusterConfig{ Name: ClusterFlagValue(), @@ -321,7 +326,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,