Skip to content

Commit

Permalink
replace _ with + for OCI artifacts tags when pulled for helm
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan-Adrian Burciu <[email protected]>
  • Loading branch information
baburciu committed Oct 31, 2024
1 parent c8ae4b6 commit adcbcaf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/controller/helmrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,10 @@ func mutateChartWithSourceRevision(chart *chart.Chart, source sourcev1.Source) (
switch {
case strings.Contains(revision, "@"):
tagD := strings.Split(revision, "@")
tagVer, err := semver.NewVersion(tagD[0])
// replace '+' with '_' for OCI tag semver compatibility
// per https://github.com/helm/helm/blob/v3.14.4/pkg/registry/client.go#L45-L50
tagConverted := strings.ReplaceAll(tagD[0], "_", "+")
tagVer, err := semver.NewVersion(tagConverted)
if err != nil {
return "", fmt.Errorf("failed parsing artifact revision %s", tagD[0])
}
Expand Down

0 comments on commit adcbcaf

Please sign in to comment.