Update registry underscore message with semver note for extra clarity

Add newline to registry underscore message

Signed-off-by: Scott Rigby <scott@r6by.com>
pull/10521/head
Scott Rigby 3 years ago
parent 4aacbc44e0
commit 8424bc2b60
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155

@ -39,10 +39,10 @@ import (
// See https://github.com/helm/helm/issues/10166 // See https://github.com/helm/helm/issues/10166
const registryUnderscoreMessage = ` const registryUnderscoreMessage = `
OCI artifact references do not support the plus sign(+). To solve this Helm OCI artifact references (e.g. tags) do not support the plus sign (+). To support
adopts the convention of changing plus (+) to underscore (_) in chart version storing semantic versions, Helm adopts the convention of changing plus (+) to
references during registry push - and OCI artifact reference from underscore an underscore (_) in chart version tags when pushing to a registry and back to
back to plus on registry pull.` a plus (+) when pulling from a registry.`
type ( type (
// Client works with OCI-compliant registries // Client works with OCI-compliant registries
@ -372,7 +372,7 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
if strings.Contains(result.Ref, "_") { if strings.Contains(result.Ref, "_") {
fmt.Fprintf(c.out, "%s contains an underscore.\n", result.Ref) fmt.Fprintf(c.out, "%s contains an underscore.\n", result.Ref)
fmt.Fprint(c.out, registryUnderscoreMessage) fmt.Fprint(c.out, registryUnderscoreMessage+"\n")
} }
return result, nil return result, nil
@ -521,7 +521,7 @@ func (c *Client) Push(data []byte, ref string, options ...PushOption) (*PushResu
fmt.Fprintf(c.out, "Digest: %s\n", result.Manifest.Digest) fmt.Fprintf(c.out, "Digest: %s\n", result.Manifest.Digest)
if strings.Contains(result.Ref, "_") { if strings.Contains(result.Ref, "_") {
fmt.Fprintf(c.out, "%s contains an underscore.\n", result.Ref) fmt.Fprintf(c.out, "%s contains an underscore.\n", result.Ref)
fmt.Fprint(c.out, registryUnderscoreMessage) fmt.Fprint(c.out, registryUnderscoreMessage+"\n")
} }
return result, err return result, err

Loading…
Cancel
Save