Clarify normalizedVersion is for comparison only

Prevent future refactors from switching the returned tag to
the normalized form; the registry client handles '+' -> '_'.

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
pull/31347/head
Benoit Tigeot 2 weeks ago
parent eee4fee92e
commit dce5ae1707
No known key found for this signature in database
GPG Key ID: 8E6D4FC8AEBDA62C

@ -32,7 +32,7 @@ func BuildPushRef(href, chartName, chartVersion string) (string, error) {
return "", fmt.Errorf("cannot push to a reference with a digest: %q. Only tags are allowed", href)
}
// Normalize chart version for tag comparison/build (registry tags cannot contain '+')
// Normalize for comparison only; the registry client converts '+' to '_' for the actual tag
normalizedVersion := strings.ReplaceAll(chartVersion, "+", "_")
// if href tag present, it must match normalized chart version
if ref.Tag != "" && ref.Tag != normalizedVersion {

Loading…
Cancel
Save