For OCI, convert + to _ before pull, and + to _ before push

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

@ -79,6 +79,11 @@ func (pusher *OCIPusher) push(chartRef, href string) error {
path.Join(strings.TrimPrefix(href, fmt.Sprintf("%s://", registry.OCIScheme)), meta.Metadata.Name),
meta.Metadata.Version)
// Convert plus (+) to underscore (_) before push, so OCI doesn't choke
// This must remain right above client.Push()
// See https://github.com/helm/helm/issues/10166
ref = strings.ReplaceAll(ref, "+", "_")
_, err = client.Push(chartBytes, ref, pushOpts...)
return err
}

@ -54,6 +54,11 @@ func (g *OCIGetter) get(href string) (*bytes.Buffer, error) {
ref = fmt.Sprintf("%s:%s", ref, version)
}
// Convert plus (+) to underscore (_) in request string before pull
// This must remain right above client.Pull()
// See https://github.com/helm/helm/issues/10166
ref = strings.ReplaceAll(ref, "+", "_")
result, err := client.Pull(ref, pullOpts...)
if err != nil {
return nil, err

Loading…
Cancel
Save