diff --git a/pkg/registry/pushref.go b/pkg/registry/pushref.go index 17f2c5004..33c801d1a 100644 --- a/pkg/registry/pushref.go +++ b/pkg/registry/pushref.go @@ -42,8 +42,8 @@ func BuildPushRef(href, chartName, chartVersion string) (string, error) { // Ensure repository ends with the chart name once (avoid duplication) finalRepo := ref.Repository if chartName != "" { - last := chartName // Extract last segment of current repository path + var last string if idx := strings.LastIndex(finalRepo, "/"); idx >= 0 { last = finalRepo[idx+1:] } else {