From 8c98832799c443fb04f2f22304b42f3221c9a889 Mon Sep 17 00:00:00 2001 From: Fabian B Date: Tue, 19 Nov 2024 20:43:06 +0100 Subject: [PATCH] Don't concatenate u.Path and tag if tag is already in OCI URI Signed-off-by: Fabian B --- pkg/downloader/chart_downloader.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/downloader/chart_downloader.go b/pkg/downloader/chart_downloader.go index dde6a1057..6259683d2 100644 --- a/pkg/downloader/chart_downloader.go +++ b/pkg/downloader/chart_downloader.go @@ -171,7 +171,11 @@ func (c *ChartDownloader) getOciURI(ref, version string, u *url.URL) (*url.URL, } } - u.Path = fmt.Sprintf("%s:%s", u.Path, tag) + // If the tag is already inside the OCI URI, don't concatenate u.Path with tag. + // Otherwise the tag gets invalid. + if !(strings.Contains(u.Path, ":"+tag)) { + u.Path = fmt.Sprintf("%s:%s", u.Path, tag) + } return u, err }