From 75a43a03ced93c4888e6c66695e772f7e3fc2251 Mon Sep 17 00:00:00 2001 From: Alexis Williams Date: Fri, 6 Nov 2026 12:31:45 -0800 Subject: [PATCH] fix(chart): keep release versions out of view syncer volume claim labels volumeClaimTemplates is immutable, so a chart or appVersion bump made every sync of the StatefulSet fail. An existing StatefulSet has to be recreated once to take this. --- Chart.yaml | 2 +- templates/view-syncer-statefulset.yaml | 2 +- tests/test_templates.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 92754e8..f750b97 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -17,4 +17,4 @@ sources: - https://github.com/rocicorp/zero - https://github.com/synapdeck/zero-cache-chart type: application -version: 2.4.0 +version: 2.4.1 diff --git a/templates/view-syncer-statefulset.yaml b/templates/view-syncer-statefulset.yaml index 2b3997b..dd1f6c2 100644 --- a/templates/view-syncer-statefulset.yaml +++ b/templates/view-syncer-statefulset.yaml @@ -157,7 +157,7 @@ spec: - metadata: name: data labels: - {{- include "zero-cache.labels" . | nindent 10 }} + {{- include "zero-cache.selectorLabels" . | nindent 10 }} app.kubernetes.io/component: view-syncer {{- with .Values.viewSyncer.persistence.annotations }} annotations: diff --git a/tests/test_templates.py b/tests/test_templates.py index 543c017..217b354 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -193,3 +193,14 @@ def test_view_syncer_self_drain_outlasts_liveness_failure_and_prestop(): probe = container["livenessProbe"] detection_seconds = probe["periodSeconds"] * probe.get("failureThreshold", 3) assert int(env_value(container, "ZERO_SELF_DRAIN_DELAY_MS")) > (detection_seconds + 10) * 1000 + + +def test_view_syncer_volume_claim_labels_ignore_release_versions(): + # volumeClaimTemplates is immutable, so a label that moves with a release + # makes every upgrade of the StatefulSet fail. + rendered = render() + statefulset = workload(rendered, "StatefulSet", "zero-cache-view-syncer") + labels = statefulset["spec"]["volumeClaimTemplates"][0]["metadata"]["labels"] + assert "helm.sh/chart" not in labels + assert "app.kubernetes.io/version" not in labels + assert labels["app.kubernetes.io/component"] == "view-syncer"