lint and TODO comment
parent
f712dd62f3
commit
010b29c178
|
@ -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})
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue