make constant profile funcs more testable

pull/4811/head
Medya Gh 2019-07-19 10:21:47 -07:00
parent cd80371aad
commit 14fcdaa98b
1 changed files with 12 additions and 4 deletions

View File

@ -188,13 +188,21 @@ var ConfigFilePath = MakeMiniPath("config")
var ConfigFile = MakeMiniPath("config", "config.json") var ConfigFile = MakeMiniPath("config", "config.json")
// GetProfileFile returns the Minikube profile config file // GetProfileFile returns the Minikube profile config file
func GetProfileFile(profile string) string { func GetProfileFile(profile string, miniHome ...string) string {
return filepath.Join(GetMinipath(), "profiles", profile, "config.json") miniPath := GetMinipath()
if len(miniHome) > 0 {
miniPath = miniHome[0]
}
return filepath.Join(miniPath, "profiles", profile, "config.json")
} }
// GetProfilePath returns the Minikube profile path of config file // GetProfilePath returns the Minikube profile path of config file
func GetProfilePath(profile string) string { func GetProfilePath(profile string, miniHome ...string) string {
return filepath.Join(GetMinipath(), "profiles", profile) miniPath := GetMinipath()
if len(miniHome) > 0 {
miniPath = miniHome[0]
}
return filepath.Join(miniPath, "profiles", profile)
} }
// AddonsPath is the default path of the addons configuration // AddonsPath is the default path of the addons configuration