lint and TODO comment

pull/5068/head
Medya Gh 2019-08-13 14:24:30 -07:00
parent f712dd62f3
commit 010b29c178
2 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
pkgConfig "k8s.io/minikube/pkg/minikube/config" //TODO:Medyagh
pkgConfig "k8s.io/minikube/pkg/minikube/config" //TODO:Medyagh have consistent naming everywhere pk_config
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/kubeconfig"
@ -50,7 +50,10 @@ var ProfileCmd = &cobra.Command{
}
if !pkgConfig.ProfileExists(profile) {
pkgConfig.CreateEmptyProfile(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})
}

View File

@ -44,12 +44,9 @@ func ProfileExists(name string, miniHome ...string) bool {
miniPath = miniHome[0]
}
p := profileFilePath(name, miniHome...)
p := profileFilePath(name, miniPath)
_, err := os.Stat(p)
if err != nil {
return false
}
return true
return err != nil
}
// CreateProfile creates an empty profile stores in $MINIKUBE_HOME/profiles/<profilename>/config.json