Prevent failure when resolving version tags in oras memory store

- The newReference() function transforms version tags by replacing + with _ for OCI compatibility
- But the code was using the original ref (with +) for TagBytes()
- Then it tries to find the tagged reference using parsedRef.String() (with _)
- This mismatch causes the Resolve method to fail with "not found"
- By using parsedRef.String() consistently in both places, the references will match and the lookup will succeed.

Close: https://github.com/helm/helm/issues/30881
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
pull/30889/head
Benoit Tigeot 4 months ago
parent e6122aba27
commit 10427fc0e4
No known key found for this signature in database
GPG Key ID: 8E6D4FC8AEBDA62C

@ -693,7 +693,7 @@ func (c *Client) Push(data []byte, ref string, options ...PushOption) (*PushResu
return nil, err
}
manifestDescriptor, err := oras.TagBytes(ctx, memoryStore, ocispec.MediaTypeImageManifest, manifestData, ref)
manifestDescriptor, err := oras.TagBytes(ctx, memoryStore, ocispec.MediaTypeImageManifest, manifestData, parsedRef.String())
if err != nil {
return nil, err
}

Loading…
Cancel
Save