From 089deef706660a6d8f3966ab1d62006f2ba1bf73 Mon Sep 17 00:00:00 2001 From: aallbright Date: Mon, 17 Feb 2020 19:08:00 -0500 Subject: [PATCH] Do not create profiles that do not exist --- cmd/minikube/cmd/config/profile.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/minikube/cmd/config/profile.go b/cmd/minikube/cmd/config/profile.go index 7784024089..280bb1c237 100644 --- a/cmd/minikube/cmd/config/profile.go +++ b/cmd/minikube/cmd/config/profile.go @@ -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) @@ -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}) }, }