From 639c1ba4e9b8bbea3f2822359169da403bf45aeb Mon Sep 17 00:00:00 2001 From: Rashmi K A Date: Sun, 21 Jan 2024 14:19:50 -0800 Subject: [PATCH] fix: fix oci tag error in helm push Signed-off-by: Rashmi K A --- pkg/uploader/chart_uploader.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/uploader/chart_uploader.go b/pkg/uploader/chart_uploader.go index d7e940406..1ed68d83c 100644 --- a/pkg/uploader/chart_uploader.go +++ b/pkg/uploader/chart_uploader.go @@ -24,6 +24,7 @@ import ( "helm.sh/helm/v3/pkg/pusher" "helm.sh/helm/v3/pkg/registry" + "strings" ) // ChartUploader handles uploading a chart. @@ -49,6 +50,12 @@ func (c *ChartUploader) UploadTo(ref, remote string) error { return fmt.Errorf("scheme prefix missing from remote (e.g. \"%s://\")", registry.OCIScheme) } + // See: https://github.com/helm/helm/issues/12728 + path := strings.SplitN(u.Path, ":", 2) + if len(path) > 1 { + return fmt.Errorf("Version tag \"%s\" need not be passed for remote", path[1]) + } + p, err := c.Pushers.ByScheme(u.Scheme) if err != nil { return err