From a45c9a681d623850abf628e5ce5f7fcbcb00781c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Marc=C3=A9?= Date: Sun, 5 Oct 2025 23:41:35 +0200 Subject: [PATCH] refactor: in ensureMissingRepos, use the alias (when present) as the key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tarek Marcé --- pkg/downloader/manager.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index 5e2953969..f3a6e8e6f 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -506,6 +506,10 @@ func (m *Manager) ensureMissingRepos(repoNames map[string]string, deps []*chart. var ru []*repo.Entry for _, dd := range deps { + chartName := dd.Name + if dd.Alias != "" { + chartName = dd.Alias + } // If the chart is in the local charts directory no repository needs // to be specified. @@ -514,7 +518,7 @@ func (m *Manager) ensureMissingRepos(repoNames map[string]string, deps []*chart. } // When the repoName for a dependency is known we can skip ensuring - if _, ok := repoNames[dd.Name]; ok { + if _, ok := repoNames[chartName]; ok { continue } @@ -530,7 +534,7 @@ func (m *Manager) ensureMissingRepos(repoNames map[string]string, deps []*chart. } rn = managerKeyPrefix + rn - repoNames[dd.Name] = rn + repoNames[chartName] = rn // Assuming the repository is generally available. For Helm managed // access controls the repository needs to be added through the user