From 23989f9e2411aa603066356076f43840bcd2d212 Mon Sep 17 00:00:00 2001 From: Andrew Block Date: Wed, 12 Jan 2022 14:32:42 -0600 Subject: [PATCH] Updates to chart downloader Signed-off-by: Andrew Block --- pkg/downloader/chart_downloader.go | 6 ++---- pkg/downloader/manager.go | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/downloader/chart_downloader.go b/pkg/downloader/chart_downloader.go index 879c36d36..b8853a1a6 100644 --- a/pkg/downloader/chart_downloader.go +++ b/pkg/downloader/chart_downloader.go @@ -141,7 +141,7 @@ func (c *ChartDownloader) DownloadTo(ref, version, dest string) (string, *proven func (c *ChartDownloader) getOciURI(ref, version string, u *url.URL) (*url.URL, error) { // Retrieve list of repository tags - tags, err := c.RegistryClient.Tags(ref) + tags, err := c.RegistryClient.Tags(strings.TrimPrefix(ref, fmt.Sprintf("%s://", registry.OCIScheme))) if err != nil { return nil, err } @@ -160,8 +160,6 @@ func (c *ChartDownloader) getOciURI(ref, version string, u *url.URL) (*url.URL, return nil, err } - // TODO Find a net/url equivalent of this - //ref = fmt.Sprintf("%s:%s", ref, tag) u.Path = fmt.Sprintf("%s:%s", u.Path, tag) return u, err @@ -188,7 +186,7 @@ func (c *ChartDownloader) ResolveChartVersion(ref, version string) (*url.URL, er return nil, errors.Errorf("invalid chart URL format: %s", ref) } - if registry.IsOCI(u.Path) { + if registry.IsOCI(u.String()) { return c.getOciURI(ref, version, u) } diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index aa2c4a2f4..cc59ae864 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -332,6 +332,7 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error { Keyring: m.Keyring, RepositoryConfig: m.RepositoryConfig, RepositoryCache: m.RepositoryCache, + RegistryClient: m.RegistryClient, Getters: m.Getters, Options: []getter.Option{ getter.WithBasicAuth(username, password),