Repository navigation
Conversation
|
Thanks for this — the diagnosis is right, the helper is well built, and updating Two things before this can land. 1. The pod still restarts — the chart version is also in the pod template labels
Those live inside Note Could you include the label fix here? The line is generator-owned, so it needs the same two-place treatment you already used for the checksums: Two shapes, and I'd suggest the second:
Either is safe with respect to the selector: 2. Please add a regression guard to
|
|
Both addressed, and thanks for the thorough review — particularly for confirming the 1. The chart version in the pod template labelsYou were right that the PR was necessary but not sufficient. Reproduced your measurement first — pod template across a chart+appVersion bump with image tags pinned: - helm.sh/chart: altinity-clickhouse-operator-0.27.3
+ helm.sh/chart: altinity-clickhouse-operator-99.99.99
- app.kubernetes.io/version: "0.27.3"
+ app.kubernetes.io/version: "99.99.99"Went with your second option, the dedicated helper, for the reason you gave — Two-place treatment as you asked: After:
A note on regenerating: running the generator with my local yq/jq also reformatted the four CRDs and stripped trailing newlines from 2. Regression guard in
|
The annotations hashed the entire rendered ConfigMap, whose metadata.labels include helm.sh/chart. That value changes on every chart version bump, so the operator was restarted on every upgrade even when no configuration had changed. Add an altinity-clickhouse-operator.configMapContentHash helper that hashes only the data, emit it from dev/generate_helm_chart.sh, and regenerate the deployment template. Signed-off-by: Ilia Lazebnik <ilia.lazebnik@gmail.com>
The content-only checksums were necessary but not sufficient. The pod template labels render through the full labels helper, which emits helm.sh/chart and app.kubernetes.io/version. Both sit inside spec.template, so they feed pod-template-hash and roll the Deployment on a chart bump on their own, even with the image tag pinned and the checksums stable. Add altinity-clickhouse-operator.podTemplateLabels, the labels helper minus those two, and use it for the pod template. managed-by and any user commonLabels are kept, so this does not trade one regression for another, and the selector is untouched because it uses selectorLabels. The line is generator-owned, so dev/generate_helm_chart.sh and the generated Deployment are updated together. Add the regression guard to dev/test_helm_chart.sh: the pod template must be byte-identical across a chart and appVersion bump with image tags pinned, and checksum/files must still move when the mounted data changes. The first assertion also catches a revert of the content-hash helper, since that would put a changing checksum back into the pod template. Also note in the helper comment that fromYaml decodes only the first document of a multi-document file.
11dc667 to
328a93a
Compare
|
It died at 27m56s during Nothing to rebase: against the base branch the branch is Could someone with write access re-run the failed job? |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mutation set configs.files.config.yaml to a string, which values.schema.json rejects, so the render failed, the grep came back empty and the empty value counted as a moved hash: a frozen checksum passed. Use watchNamespaces, which is schema-legal and rendered into config.yaml, and require both renders to succeed and carry the annotation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The
checksum/*pod annotations on the operator Deployment hash the entire rendered ConfigMap, and the manifest'smetadata.labelsincludehelm.sh/chart. That value changes on every chart version bump, so the operator pod is restarted on everyhelm upgradeeven when none of the config files changed.This adds an
altinity-clickhouse-operator.configMapContentHashhelper that hashes only thedata/binaryDatasections, emits it fromdev/generate_helm_chart.sh, and regeneratesDeployment-clickhouse-operator.yaml— all nine annotations (files,confd-files,configd-files,templatesd-files,usersd-filesand the fourkeeper-*ones).Running the generator before and after the change produces a diff limited to those nine lines. Rendered against a bumped chart version the checksums are unchanged, and adding a file to
configs.configdFilesstill changes the matching checksum.helm lintpasses.No chart version bump here, since the chart version tracks the operator release.
The same fix was recently made in the argo-cd chart (argoproj/argo-helm#4044); the loki chart uses the same data-only hashing.