Skip to content

Commit

Permalink
Support downloading existing index from private repo
Browse files Browse the repository at this point in the history
  • Loading branch information
annabarnes1138 committed May 26, 2021
1 parent c061938 commit 181ff58
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/releaser/releaser.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,15 @@ func (r *Releaser) UpdateIndexFile() (bool, error) {

var indexFile *repo.IndexFile

resp, err := r.httpClient.Get(fmt.Sprintf("%s/index.yaml", r.config.ChartsRepo))
indexUrl := fmt.Sprintf("%s/index.yaml", r.config.ChartsRepo)
if r.config.Token != "" {
chartsRepoUrl, _ := url.Parse(r.config.ChartsRepo)
indexUrl = fmt.Sprintf("%s://%s@%s/%s/index.yaml",
chartsRepoUrl.Scheme, r.config.Token,
chartsRepoUrl.Host, chartsRepoUrl.Path)
}

resp, err := r.httpClient.Get(indexUrl)
if err != nil {
return false, err
}
Expand Down

0 comments on commit 181ff58

Please sign in to comment.