From 70ffdd217b1a08dfd9f0664c4ea1ab59a4747124 Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Sat, 6 Jun 2026 11:34:57 +0300 Subject: [PATCH] review: replace repoUrl with cr.Config.URL Signed-off-by: Denis Nutiu --- pkg/downloader/manager.go | 2 +- pkg/downloader/manager_test.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index 5272d7452..2b7d3e40a 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -744,7 +744,7 @@ func (m *Manager) findChartURL(name, version, repoURL, repoName string, repos ma var ve *repo.ChartVersion ve, err = findVersionedEntry(version, entry) if err == nil { - url, err = repo.ResolveReferenceURL(repoURL, ve.URLs[0]) + url, err = repo.ResolveReferenceURL(cr.Config.URL, ve.URLs[0]) if err == nil { username = cr.Config.Username password = cr.Config.Password diff --git a/pkg/downloader/manager_test.go b/pkg/downloader/manager_test.go index f68a35c4c..0b1c4db9a 100644 --- a/pkg/downloader/manager_test.go +++ b/pkg/downloader/manager_test.go @@ -202,9 +202,12 @@ repositories: 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" version := "0.1.0" - repoURL := "http://example.com/charts" // 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)