stakater / Reloader

A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!
https://docs.stakater.com/reloader/
Apache License 2.0
7.47k stars 498 forks source link

fix: replace + with _ in Chart.Version #686

Closed jfroy closed 3 months ago

jfroy commented 3 months ago

When using Flux with the OCI chart, the chart version has a git hash suffix (ex: 1.0.107+20eb5010550b), which is invalid as a metadata label.

github-actions[bot] commented 3 months ago

@jfroy Images are available for testing. docker pull ghcr.io/stakater/reloader:SNAPSHOT-PR-686-5d6309b9\ndocker pull ghcr.io/stakater/reloader:SNAPSHOT-PR-686-UBI-5d6309b9

MuneebAijaz commented 3 months ago

@jfroy can you provide more details around the issue? and if possible, do provide the FluxCD CRs you are applying

jfroy commented 3 months ago

@jfroy can you provide more details around the issue? and if possible, do provide the FluxCD CRs you are applying

When using the recommended Flux 2.3 chartRef method to install an OCI helm chart, Flux sets the git hash as the chart semantic version metadata, which yields a version string of the form "major.minor.patch+git", per the SemVer spec.

Unfortunately, this yields an invalid Kubernetes label, and charts that include their version as a label will fail to install. The fix is generally to substitute the '+' for a '_', as suggested in the Flux CHANGELOG. Other charts have followed this approach, such as Kyverno.

Here is my HelmRelease and OCIRepository.

MuneebAijaz commented 3 months ago

hi @jfroy thanks for providing context, i will get back to this soon