From 1597fcb0bce2a135f0aa5ffacbc04a4da1d7d96d Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Fri, 25 Aug 2017 15:49:40 -0700 Subject: [PATCH] added a RelativeIndex() func to helmhome to return a relative path to the index files. Also updated repo_add.go to use this new fun --- cmd/helm/repo_add.go | 2 +- pkg/helm/helmpath/helmhome.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/helm/repo_add.go b/cmd/helm/repo_add.go index b172d016c..7fb20d02d 100644 --- a/cmd/helm/repo_add.go +++ b/cmd/helm/repo_add.go @@ -86,7 +86,7 @@ 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, diff --git a/pkg/helm/helmpath/helmhome.go b/pkg/helm/helmpath/helmhome.go index b5ec4909e..3c35c3b69 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")