diff --git a/pkg/downloader/chart_downloader.go b/pkg/downloader/chart_downloader.go index 879c36d3631..b8853a1a6c7 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 aa2c4a2f448..cc59ae864a3 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),