Skip to content

Commit 8e1d5d2

Browse files
Fix bug where K8s config and Nomad config were being written to /home/nicj. This does not exist on Windows
1 parent f5938bd commit 8e1d5d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/utils/utils.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
3436
func 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
6870
func 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
8486
func 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

Comments
 (0)