From 1a9cb93551dd112ab91c0dd0982819979787e637 Mon Sep 17 00:00:00 2001 From: Andrew Block Date: Wed, 12 Jan 2022 15:49:12 -0600 Subject: [PATCH] Handling name of OCI file Signed-off-by: Andrew Block --- pkg/action/pull.go | 1 + pkg/downloader/chart_downloader.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/action/pull.go b/pkg/action/pull.go index 6de08a6da66..55a127d4d7a 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -87,6 +87,7 @@ func (p *Pull) Run(chartRef string) (string, error) { getter.WithTLSClientConfig(p.CertFile, p.KeyFile, p.CaFile), getter.WithInsecureSkipVerifyTLS(p.InsecureSkipTLSverify), }, + RegistryClient: p.cfg.RegistryClient, RepositoryConfig: p.Settings.RepositoryConfig, RepositoryCache: p.Settings.RepositoryCache, } diff --git a/pkg/downloader/chart_downloader.go b/pkg/downloader/chart_downloader.go index b8853a1a6c7..8bcd7639569 100644 --- a/pkg/downloader/chart_downloader.go +++ b/pkg/downloader/chart_downloader.go @@ -103,7 +103,8 @@ func (c *ChartDownloader) DownloadTo(ref, version, dest string) (string, *proven name := filepath.Base(u.Path) if u.Scheme == registry.OCIScheme { - name = fmt.Sprintf("%s-%s.tgz", name, version) + idx := strings.LastIndexByte(name, ':') + name = fmt.Sprintf("%s-%s.tgz", name[:idx], name[idx+1:]) } destfile := filepath.Join(dest, name)