From 81e4fc0d1ca90c495801f3e5726c81a807a3c26b Mon Sep 17 00:00:00 2001 From: Dimitris Aragiorgis Date: Fri, 8 Oct 2021 12:06:02 -0400 Subject: [PATCH] Support changing apiserver-ips along with apiserver-names (#9818) After commit bee6815, we could not change the apiserver-ips after initial `minikube start`. Revert to previous behavior where both apiserver-ips and apiserver-names were taken always into account and certs were updated accordingly. Signed-off-by: Dimitris Aragiorgis --- cmd/minikube/cmd/start_flags.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index ba87db888eef..4b972de5dae4 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -677,6 +677,12 @@ func updateExistingConfigFromFlags(cmd *cobra.Command, existing *config.ClusterC cc.VerifyComponents = interpretWaitFlag(*cmd) } + if cmd.Flags().Changed("apiserver-ips") { + // IPSlice not supported in Viper + // https://github.com/spf13/viper/issues/460 + cc.KubernetesConfig.APIServerIPs = apiServerIPs + } + // Handle flags and legacy configuration upgrades that do not contain KicBaseImage if cmd.Flags().Changed(kicBaseImage) || cc.KicBaseImage == "" { cc.KicBaseImage = viper.GetString(kicBaseImage)