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

pull/2862/head
Ryan Payton 8 years ago
parent fccb5538e9
commit a996f6089e

@ -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

@ -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")

Loading…
Cancel
Save