Document the new function

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
pull/11109/head
Richard Wall 3 years ago
parent 11be490d8a
commit a406711758

@ -640,8 +640,12 @@ func (c *Client) Tags(ref string) ([]string, error) {
} }
func tagToVersion(tag string) (*semver.Version, error) { // tagToVersion parses an OCI tag string and converts it to a semantic version.
// Change underscore (_) back to plus (+) for Helm // It returns an error if the tag can not be parsed.
// semver allows plus (+) which is now allowed in OCI tags, so these will have
// been converted to underscore (_) by helm push.
// This function will change underscore (_) in the tag back to plus (+).
// See https://github.com/helm/helm/issues/10166 // See https://github.com/helm/helm/issues/10166
func tagToVersion(tag string) (*semver.Version, error) {
return semver.NewVersion(strings.ReplaceAll(tag, "_", "+")) return semver.NewVersion(strings.ReplaceAll(tag, "_", "+"))
} }

Loading…
Cancel
Save