Skip to content

Commit

Permalink
Merge pull request #6828 from josedonizetti/fix-start-for-existing-pr…
Browse files Browse the repository at this point in the history
…ofile

Fix start for existing profile
  • Loading branch information
medyagh authored Feb 28, 2020
2 parents 256b90a + c412a8a commit 4677bce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,19 +436,19 @@ func selectDriver(existing *config.ClusterConfig) registry.DriverState {
// Technically unrelated, but important to perform before detection
driver.SetLibvirtURI(viper.GetString(kvmQemuURI))

if viper.GetString("vm-driver") != "" {
ds := driver.Status(viper.GetString("vm-driver"))
out.T(out.Sparkle, `Using the {{.driver}} driver based on user configuration`, out.V{"driver": ds.String()})
return ds
}

// By default, the driver is whatever we used last time
if existing != nil && existing.Driver != "" {
ds := driver.Status(existing.Driver)
out.T(out.Sparkle, `Using the {{.driver}} driver based on existing profile`, out.V{"driver": ds.String()})
return ds
}

if viper.GetString("vm-driver") != "" {
ds := driver.Status(viper.GetString("vm-driver"))
out.T(out.Sparkle, `Using the {{.driver}} driver based on user configuration`, out.V{"driver": ds.String()})
return ds
}

pick, alts := driver.Suggest(driver.Choices())
if pick.Name == "" {
exit.WithCodeT(exit.Config, "Unable to determine a default driver to use. Try specifying --vm-driver, or see https://minikube.sigs.k8s.io/docs/start/")
Expand Down

0 comments on commit 4677bce

Please sign in to comment.