Merge pull request from priyawadhwa/install-addons

Fix bug in --install-addons flag
pull/6703/head
Medya Ghazizadeh 2020-02-19 22:33:50 -08:00 committed by GitHub
commit 0af5734bc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions
cmd/minikube/cmd
pkg/minikube/node

View File

@ -328,9 +328,12 @@ func runStart(cmd *cobra.Command, args []string) {
ssh.SetDefaultClient(ssh.External)
}
existingAddons := map[string]bool{}
if existing != nil && existing.Addons != nil {
existingAddons = existing.Addons
var existingAddons map[string]bool
if viper.GetBool(installAddons) {
existingAddons = map[string]bool{}
if existing != nil && existing.Addons != nil {
existingAddons = existing.Addons
}
}
kubeconfig, err := node.Start(mc, n, true, existingAddons)
if err != nil {

View File

@ -74,11 +74,9 @@ func Start(mc config.MachineConfig, n config.Node, primary bool, existingAddons
configureMounts()
// enable addons, both old and new!
ea := map[string]bool{}
if existingAddons != nil {
ea = existingAddons
addons.Start(viper.GetString(config.MachineProfile), existingAddons, AddonList)
}
addons.Start(viper.GetString(config.MachineProfile), ea, AddonList)
if err = CacheAndLoadImagesInConfig(); err != nil {
out.T(out.FailureType, "Unable to load cached images from config file.")