Handling name of OCI file

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

@ -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,
}

@ -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)

Loading…
Cancel
Save