Updates to chart downloader

Signed-off-by: Andrew Block <andy.block@gmail.com>
pull/10527/head
Andrew Block 3 years ago
parent ba4020770e
commit 23989f9e24
No known key found for this signature in database
GPG Key ID: 02DFE631AEF35EBC

@ -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) { func (c *ChartDownloader) getOciURI(ref, version string, u *url.URL) (*url.URL, error) {
// Retrieve list of repository tags // 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 { if err != nil {
return nil, err return nil, err
} }
@ -160,8 +160,6 @@ func (c *ChartDownloader) getOciURI(ref, version string, u *url.URL) (*url.URL,
return nil, err 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) u.Path = fmt.Sprintf("%s:%s", u.Path, tag)
return u, err 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) 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) return c.getOciURI(ref, version, u)
} }

@ -332,6 +332,7 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error {
Keyring: m.Keyring, Keyring: m.Keyring,
RepositoryConfig: m.RepositoryConfig, RepositoryConfig: m.RepositoryConfig,
RepositoryCache: m.RepositoryCache, RepositoryCache: m.RepositoryCache,
RegistryClient: m.RegistryClient,
Getters: m.Getters, Getters: m.Getters,
Options: []getter.Option{ Options: []getter.Option{
getter.WithBasicAuth(username, password), getter.WithBasicAuth(username, password),

Loading…
Cancel
Save