Repository navigation
Conversation
The checksum/* annotations hashed the entire rendered ConfigMap or Secret, whose metadata.labels include helm.sh/chart. That value changes on every chart version bump, so every Airflow component was restarted on upgrade even when no configuration had changed. Add an airflow.configMapOrSecretContentHash helper that hashes only the data and stringData sections, and use it for all 37 checksum/* annotations. A pure chart version bump no longer changes the checksums, while any real config change still restarts the pods.
Both were missing from this PR. The test pins the contract in two directions: a label added through the labels value, which lands in the same metadata.labels block as chart: airflow-<version>, must not move any checksum, and a real config change must still move checksum/airflow-config. Reverting the fix in one deployment fails the first assertion. The chart version itself is not settable through values, so an object label stands in for it. Signed-off-by: Ilia Lazebnik <[email protected]>
58276f3 to
c8f5704
Compare
|
Rebased onto current Also added the two things this PR was missing: Newsfragment — A regression test —
I verified it's a real guard rather than assuming. Reverting the fix in one deployment fails the first assertion, and the mechanism is visible directly: One thing worth recording for anyone verifying this by hand:
|
check-newsfragments-are-valid requires exactly one line for every type except significant, and this one had a summary plus a body paragraph. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
| @@ -0,0 +1 @@ | |||
| Hash only ``data`` and ``stringData`` in the ``checksum/*`` pod annotations, instead of each rendered ConfigMap and Secret in full, so that ``helm.sh/chart`` in their labels no longer moves the checksums and restarts every component on a chart version bump whose configuration is unchanged | |||
There was a problem hiding this comment.
According to the latest changes (https://github.com/apache/airflow/blob/main/contributing-docs/18_contribution_workflow.rst#newsfragments), we use only significant newsfragments.
| Compute a ConfigMap or Secret checksum from its data only, for the checksum/* pod annotations. | ||
| The full manifest carries the helm.sh/chart label, which changes on every chart version bump and | ||
| would restart every Airflow component on upgrade even when no configuration changed. |
There was a problem hiding this comment.
| Compute a ConfigMap or Secret checksum from its data only, for the checksum/* pod annotations. | |
| The full manifest carries the helm.sh/chart label, which changes on every chart version bump and | |
| would restart every Airflow component on upgrade even when no configuration changed. | |
| Compute a ConfigMap or Secret checksum from its data only, for the checksum/* pod annotations. | |
| The full manifest carries labels, which may change on every chart deployment and | |
| would restart every Airflow component on upgrade even when no configuration changes. |
| # The checksum/* annotations exist so that a configuration change restarts the component that | ||
| # reads it. Hashing the whole rendered manifest also pulled in metadata.labels, which carry | ||
| # helm.sh/chart, so the checksums moved on a chart version bump and every component restarted | ||
| # even though nothing it reads had changed. | ||
|
|
||
| # A label added through the `labels` value lands in the same metadata.labels block as | ||
| # chart: "airflow-<version>", so it stands in for the chart version, which is not settable | ||
| # through values. | ||
| # |
There was a problem hiding this comment.
| # The checksum/* annotations exist so that a configuration change restarts the component that | |
| # reads it. Hashing the whole rendered manifest also pulled in metadata.labels, which carry | |
| # helm.sh/chart, so the checksums moved on a chart version bump and every component restarted | |
| # even though nothing it reads had changed. | |
| # A label added through the `labels` value lands in the same metadata.labels block as | |
| # chart: "airflow-<version>", so it stands in for the chart version, which is not settable | |
| # through values. | |
| # |
I think it is pretty natural to reload only on a config change. We do not rather need a justification for this change living in the code.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
7938649 to
e6e4e67
Compare
The
checksum/*pod annotations hash the entire rendered ConfigMap or Secret, and the manifest'smetadata.labelsincludehelm.sh/chart. That value changes on every chart version bump, so every Airflow component is restarted onhelm upgradeeven when no configuration has changed.This adds an
airflow.configMapOrSecretContentHashhelper that hashes only thedata/stringDatasections, and uses it for all 37checksum/*annotations across the api-server, scheduler, dag-processor, triggerer, worker, flower, statsd, otel-collector and pgbouncer templates.Rendering the chart at 2.0.0 against a bumped version with identical values is now byte-identical, while changing
config.core.parallelismstill moveschecksum/airflow-config. The full helm test suite passes (2155 tests).The same fix was recently made in the argo-cd chart (argoproj/argo-helm#4044); the loki chart uses the same data-only hashing.
Unrelated, but found while testing:
checksum/jwt-secretis unstable on every render, and even differs between two pods in the same render, becausechart/templates/secrets/jwt-secret.yamldefaults torandAlphaNum 128and eachincludere-evaluates it. WithjwtSecretunset those pods restart on every upgrade regardless of this change. Happy to open a separate issue or PR for that.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 5 (Claude Code) following the guidelines