Skip to content

Commit

Permalink
Do not create profiles that do not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
aallbrig committed Feb 18, 2020
1 parent 52c200a commit 089deef
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/minikube/cmd/config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ var ProfileCmd = &cobra.Command{
}

if !pkgConfig.ProfileExists(profile) {
err := pkgConfig.CreateEmptyProfile(profile)
if err != nil {
exit.WithError("Creating a new profile failed", err)
}
out.SuccessT("Created a new profile : {{.profile_name}}", out.V{"profile_name": profile})
out.FailureT("if you want to create a profile you can by this command: minikube start -p {{.profile_name}}", out.V{"profile_name": profile})
}

err := Set(pkgConfig.MachineProfile, profile)
Expand All @@ -91,7 +87,7 @@ var ProfileCmd = &cobra.Command{
out.ErrT(out.Sad, `Error while setting kubectl current context : {{.error}}`, out.V{"error": err})
}
}
out.SuccessT("minikube profile was successfully set to {{.profile_name}}", out.V{"profile_name": profile})
}
out.SuccessT("minikube profile was successfully set to {{.profile_name}}", out.V{"profile_name": profile})
},
}

0 comments on commit 089deef

Please sign in to comment.