Skip to content

Commit badbbf2

Browse files
authored
fix: sanitize chart version label to handle semver build metadata (#287)
When deploying via Flux HelmRelease with an OCIRepository chartRef, Flux appends a truncated OCI digest as semver build metadata to the chart version (e.g. `0.52.0+0d502f14f06f`). The `+` character is invalid in Kubernetes label values, causing all resources with the `helm.sh/chart-version` label to be rejected. Replace `+` with `_` in the label value to ensure compatibility.
1 parent 70693a3 commit badbbf2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

charts/mcp-operator/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Common labels
9494
*/}}
9595
{{- define "mcp-operator.labels" -}}
9696
helm.sh/chart-name: {{ .Chart.Name }}
97-
helm.sh/chart-version: {{ .Chart.Version | quote }}
97+
helm.sh/chart-version: {{ .Chart.Version | replace "+" "_" | quote }}
9898
{{ include "mcp-operator.selectorLabels" . }}
9999
{{- if .Chart.AppVersion }}
100100
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}

0 commit comments

Comments
 (0)