review: replace repoUrl with cr.Config.URL

Signed-off-by: Denis Nutiu <dnutiu@hey.com>
pull/32186/head
Denis Nutiu 4 months ago
parent 75856bf51b
commit 70ffdd217b

@ -744,7 +744,7 @@ func (m *Manager) findChartURL(name, version, repoURL, repoName string, repos ma
var ve *repo.ChartVersion var ve *repo.ChartVersion
ve, err = findVersionedEntry(version, entry) ve, err = findVersionedEntry(version, entry)
if err == nil { if err == nil {
url, err = repo.ResolveReferenceURL(repoURL, ve.URLs[0]) url, err = repo.ResolveReferenceURL(cr.Config.URL, ve.URLs[0])
if err == nil { if err == nil {
username = cr.Config.Username username = cr.Config.Username
password = cr.Config.Password password = cr.Config.Password

@ -202,9 +202,12 @@ repositories:
t.Fatal(err) t.Fatal(err)
} }
// Find with repo-alias-1 and a repoURL that differs from cr.Config.URL
// (no trailing slash vs with trailing slash). Should still resolve correctly
// because it uses cr.Config.URL as the base for relative chart URLs.
repoURL := "http://example.com/charts"
name := "alpine" name := "alpine"
version := "0.1.0" version := "0.1.0"
repoURL := "http://example.com/charts"
// Look up by repo-alias-1 name -> should get user1/pass1 // Look up by repo-alias-1 name -> should get user1/pass1
churl, username, password, _, passCredentialsAll, _, _, _, err := m.findChartURL(name, version, repoURL, "repo-alias-1", repos) churl, username, password, _, passCredentialsAll, _, _, _, err := m.findChartURL(name, version, repoURL, "repo-alias-1", repos)

Loading…
Cancel
Save