--apiserver-names does not work as expected when you run minikube start a second time #8990
Labels
good first issue
Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/bug
Categorizes issue or PR as related to a bug.
priority/important-longterm
Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Related issue: #8658
Steps to reproduce the issue:
Version:
Details: it is right when you first run the minikube start command, and when you re-run the minikube start with the same flags, it is wrong. So if you just run a new minikube, you will not reproduce it. I found the code which cause this error:
First Run
https://github.com/kubernetes/minikube/blob/master/cmd/minikube/cmd/start_flags.go#L162
Second Run
https://github.com/kubernetes/minikube/blob/master/cmd/minikube/cmd/start_flags.go#L539
Because the apiserverNames is first get by
StringArrayVar
which support the above format of--apiserver-names=k8s-beta.example.com --apiserver-names=k8s-prod-replica.example.com
to specify multiple values for a single flag, but when you re-run minikue, it will useviper.GetStringSlice
to get the values from the command line flags.viper.GetStringSlice
supports the format of--apiserver-names=k8s-beta.example.com,k8s-prod-replica.example.com
.So when you output the values of the above code, it will output:
I write a simple program to express what happens.
Output:
The text was updated successfully, but these errors were encountered: