Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Updates to chart downloader
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Block <andy.block@gmail.com>
  • Loading branch information
sabre1041 committed Jan 12, 2022
1 parent ba40207 commit 23989f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/downloader/chart_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand All @@ -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)
}

Expand Down
1 change: 1 addition & 0 deletions pkg/downloader/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 23989f9

Please sign in to comment.