提交 a01e6dd5 编写于 作者: M Medya Gh

notify user of skipping

上级 4fd29be5
...@@ -56,12 +56,15 @@ var ProfileCmd = &cobra.Command{ ...@@ -56,12 +56,15 @@ var ProfileCmd = &cobra.Command{
if err != nil && !os.IsNotExist(err) { if err != nil && !os.IsNotExist(err) {
console.ErrLn("Error loading profile config: %v", err) console.ErrLn("Error loading profile config: %v", err)
} }
// don't change context is user has started the minikube with --keep-context if cc.MachineConfig.KeepContext {
if !cc.MachineConfig.KeepContext { console.Success("Skipped switching kubectl context for %s , because --keep-context", profile)
err = pkgutil.SetCurrentContext(constants.KubeconfigPath, profile) console.Success("To connect to this cluster, use: kubectl --context=%s", profile)
console.ErrLn("error while setting kubectl current context : %v", err) } else {
err := pkgutil.SetCurrentContext(constants.KubeconfigPath, profile)
if err != nil {
console.ErrLn("error while setting kubectl current context : %v", err)
}
} }
console.Success("minikube profile was successfully set to %s", profile) console.Success("minikube profile was successfully set to %s", profile)
}, },
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册