diff --git a/cmd/helm/repo_add.go b/cmd/helm/repo_add.go index b172d016c..c82578a3f 100644 --- a/cmd/helm/repo_add.go +++ b/cmd/helm/repo_add.go @@ -86,7 +86,8 @@ func addRepository(name, url string, home helmpath.Home, certFile, keyFile, caFi return fmt.Errorf("repository name (%s) already exists, please specify a different name", name) } - cif := home.CacheIndex(name) + cif := home.RelativeIndex(name) + c := repo.Entry{ Name: name, Cache: cif, @@ -96,6 +97,7 @@ func addRepository(name, url string, home helmpath.Home, certFile, keyFile, caFi CAFile: caFile, } + r, err := repo.NewChartRepository(&c, getter.All(settings)) if err != nil { return err diff --git a/pkg/helm/helmpath/helmhome.go b/pkg/helm/helmpath/helmhome.go index 2f9877f85..7afb96364 100644 --- a/pkg/helm/helmpath/helmhome.go +++ b/pkg/helm/helmpath/helmhome.go @@ -61,6 +61,12 @@ func (h Home) CacheIndex(name string) string { return h.Path("repository", "cache", target) } +// RelativeIndex returns the relative path to an index for the given named repository. +func (h Home) RelativeIndex(name string) string { + target := fmt.Sprintf("%s-index.yaml", name) + return filepath.Join(target) +} + // Starters returns the path to the Helm starter packs. func (h Home) Starters() string { return h.Path("starters")