|
|
|
@ -382,11 +382,11 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err
|
|
|
|
|
if fi, err := os.Stat(repoFile); err != nil {
|
|
|
|
|
fmt.Fprintf(out, "Creating %s \n", repoFile)
|
|
|
|
|
f := repo.NewRepoFile()
|
|
|
|
|
sr, err := initStableRepo(home.CacheIndex(stableRepository), out, skipRefresh)
|
|
|
|
|
sr, err := initStableRepo(home.CacheIndex(stableRepository), out, skipRefresh, home)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local"), out)
|
|
|
|
|
lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local"), out, home)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
@ -401,7 +401,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func initStableRepo(cacheFile string, out io.Writer, skipRefresh bool) (*repo.Entry, error) {
|
|
|
|
|
func initStableRepo(cacheFile string, out io.Writer, skipRefresh bool, home helmpath.Home) (*repo.Entry, error) {
|
|
|
|
|
fmt.Fprintf(out, "Adding %s repo with URL: %s \n", stableRepository, stableRepositoryURL)
|
|
|
|
|
c := repo.Entry{
|
|
|
|
|
Name: stableRepository,
|
|
|
|
@ -426,7 +426,7 @@ func initStableRepo(cacheFile string, out io.Writer, skipRefresh bool) (*repo.En
|
|
|
|
|
return &c, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func initLocalRepo(indexFile, cacheFile string, out io.Writer) (*repo.Entry, error) {
|
|
|
|
|
func initLocalRepo(indexFile, cacheFile string, out io.Writer, home helmpath.Home) (*repo.Entry, error) {
|
|
|
|
|
if fi, err := os.Stat(indexFile); err != nil {
|
|
|
|
|
fmt.Fprintf(out, "Adding %s repo with URL: %s \n", localRepository, localRepositoryURL)
|
|
|
|
|
i := repo.NewIndexFile()
|
|
|
|
@ -435,7 +435,9 @@ func initLocalRepo(indexFile, cacheFile string, out io.Writer) (*repo.Entry, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO: take this out and replace with helm update functionality
|
|
|
|
|
createLink(indexFile, cacheFile)
|
|
|
|
|
if err := createLink(indexFile, cacheFile, home); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
} else if fi.IsDir() {
|
|
|
|
|
return nil, fmt.Errorf("%s must be a file, not a directory", indexFile)
|
|
|
|
|
}
|
|
|
|
|