Conversation
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>
|
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
|
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.