-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Description
Official Helm Chart version
1.6.0 (latest released)
Apache Airflow version
2.2.3
Kubernetes Version
1.22
Helm Chart configuration
We're using Flux Helm controller v0.22.1 for deploying our helm releases.
Docker Image customisations
Yes, but this should be irrelevant for this issue.
What happened
In the newest version the Flux helm controller is appending a plus sign and a number to the chart version like so:
airflow-2.2.3+1
This chart version is set in the chart label for all deployed resources:
metadata:
name: {{ .Release.Name }}-worker
labels:
tier: airflow
component: worker
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
The issue is that kubernetes does not allow a plus sign in labels, resulting in the helm upgrade to fail with an error:
metadata.labels: Invalid value: "airflow-2.2.3+1": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')
What you think should happen instead
In standard helm charts this is handled by the _helpers.tpl file as follows:
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "esc.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
The airflow helm chart should handle the plus sign in the chart version aswell by replacing it with an underscore.
How to reproduce
Deploy airflow via Flux helmcontroller and upgrade the helm release.
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct