Avoid misleading user with ref.Tag with version dash as underscore on er

Before

```
Error: tag "0.2.0_meta" does not match provided chart version "0.1.0+meta"
```

After

```
Error: tag "0.2.0+meta" does not match provided chart version "0.1.0+meta"
```

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
pull/31347/head
Benoit Tigeot 4 months ago
parent 568d2b4bc7
commit 3a18618537
No known key found for this signature in database
GPG Key ID: 8E6D4FC8AEBDA62C

@ -36,7 +36,8 @@ func BuildPushRef(href, chartName, chartVersion string) (string, error) {
normalizedVersion := strings.ReplaceAll(chartVersion, "+", "_")
// if href tag present, it must match normalized chart version
if ref.Tag != "" && ref.Tag != normalizedVersion {
return "", fmt.Errorf("tag %q does not match provided chart version %q", ref.Tag, chartVersion)
normalizedTag := strings.ReplaceAll(ref.Tag, "_", "+")
return "", fmt.Errorf("tag %q does not match provided chart version %q", normalizedTag, chartVersion)
}
// Ensure repository ends with the chart name once (avoid duplication)

Loading…
Cancel
Save