@@ -31,6 +31,8 @@ func ValidateName(name string) (bool, error) {
3131 return true , nil
3232}
3333
34+ // ReplaceNonURIChars replaces any characters in the resrouce name which
35+ // can not be used in a URI
3436func ReplaceNonURIChars (s string ) (string , error ) {
3537 reg , err := regexp .Compile (`[^a-zA-Z0-9\-\.]+` )
3638 if err != nil {
@@ -66,7 +68,7 @@ func FQDNVolumeName(name string) string {
6668// CreateKubeConfigPath creates the file path for the KubeConfig file when
6769// using Kubernetes cluster
6870func CreateKubeConfigPath (name string ) (dir , filePath string , dockerPath string ) {
69- dir = fmt .Sprintf ("%s/.shipyard/config/%s" , os . Getenv ( "HOME" ), name )
71+ dir = fmt .Sprintf ("%s/.shipyard/config/%s" , HomeFolder ( ), name )
7072 filePath = fmt .Sprintf ("%s/kubeconfig.yaml" , dir )
7173 dockerPath = fmt .Sprintf ("%s/kubeconfig-docker.yaml" , dir )
7274
@@ -82,7 +84,7 @@ func CreateKubeConfigPath(name string) (dir, filePath string, dockerPath string)
8284// CreateNomadConfigPath creates the file path for the Nomad config file when
8385// using Kubernetes cluster
8486func CreateNomadConfigPath (name string ) (dir , filePath string ) {
85- dir = fmt .Sprintf ("%s/.shipyard/config/%s" , os . Getenv ( "HOME" ), name )
87+ dir = fmt .Sprintf ("%s/.shipyard/config/%s" , HomeFolder ( ), name )
8688 filePath = fmt .Sprintf ("%s/nomad.json" , dir )
8789
8890 // create the folders
0 commit comments