diff --git a/cmd/helm/init.go b/cmd/helm/init.go index d368945ec..7a94cfc0e 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -386,7 +386,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err if err != nil { return err } - lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local"), out, home) + lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheRelativeIndex("local"), out, home) if err != nil { return err } diff --git a/cmd/helm/init_unix.go b/cmd/helm/init_unix.go index 1117dd487..20458a182 100644 --- a/cmd/helm/init_unix.go +++ b/cmd/helm/init_unix.go @@ -20,10 +20,15 @@ package main import ( "os" + "path/filepath" "k8s.io/helm/pkg/helm/helmpath" ) func createLink(indexFile, cacheFile string, home helmpath.Home) error { - return os.Symlink(indexFile, cacheFile) + fp, err := filepath.Rel(home.Cache(), indexFile) + if err != nil { + return err + } + return os.Symlink(fp, filepath.Join(home.Cache(), cacheFile)) } diff --git a/cmd/helm/init_windows.go b/cmd/helm/init_windows.go index be17bccda..597820410 100644 --- a/cmd/helm/init_windows.go +++ b/cmd/helm/init_windows.go @@ -20,10 +20,11 @@ package main import ( "os" + "path/filepath" "k8s.io/helm/pkg/helm/helmpath" ) func createLink(indexFile, cacheFile string, home helmpath.Home) error { - return os.Link(indexFile, cacheFile) + return os.Link(indexFile, filepath.Join(home.Cache(), cacheFile)) }