container-registry / helm-charts-oci-proxy

The Helm Charts OCI Proxy, will proxy and transform Helm Chart into OCI images on the fly. Address any Helm Chart as OCI image.
GNU Affero General Public License v3.0
95 stars 7 forks source link

Improvement request: Remove special characters for image tags #19

Open mpsOxygen opened 3 months ago

mpsOxygen commented 3 months ago

Chart proxy has worked awesome until now, but I have the following issue which isn't chartproxy's fault but I think could be solved by it:

I am trying to pull the following charts into Harbor: https://SonarSource.github.io/helm-chart-sonarqube

While chartproxy transforms the chart into oci format pushing it into harbor fails because it has a + in the tag name, for example: sonarqube-dce:10.5.0+2748

It would be useful if chartproxy could remove the + and everything after it.

Vad1mo commented 3 months ago

good point, it we should check into the issue. However I don't think it is solvable, truncating after the +, would cause unpredictable behavior. Maybe converting charcters eg + -> - or _ would be an option

mpsOxygen commented 3 months ago

So I played some more with it and it seems the problem isn't with Harbor, but with chartproxy, it can't pull the helm chart because of the + sign.

Harbor is just fine with it when pushing it manually, it automatically changes the + (plus) to an _ (underscore).

user@fedora:~/proiecte/sonarqube/helm$ helm push sonarqube-dce-10.5.1+2816.tgz oci://harbor.company.com/repl-sonarqube-test
Pushed: harbor.company.com/repl-sonarqube-test/sonarqube-dce:10.5.1_2816
Digest: sha256:b9876fa2a76e7ecde1a75b48de25e847d694482f839f650e29b80d8dc586acb6
harbor.company.com/repl-sonarqube-test/sonarqube-dce:10.5.1_2816 contains an underscore.

OCI artifact references (e.g. tags) do not support the plus sign (+). To support
storing semantic versions, Helm adopts the convention of changing plus (+) to
an underscore (_) in chart version tags when pushing to a registry and back to
a plus (+) when pulling from a registry.