fix(helm): wire watchNamespaces value into operator ConfigMap#2007
fix(helm): wire watchNamespaces value into operator ConfigMap#2007jtomaszon wants to merge 2 commits into
Conversation
The configs.files.config.yaml.watch.namespaces.include field was hardcoded to [] in values.yaml and the ConfigMap template rendered it directly with no way to override it via a top-level Helm value. This patch introduces a top-level watchNamespaces value and a new configmap-files helper that deep-copies configs.files, patches the nested watch.namespaces.include in-place, then delegates to the existing configmap-data helper for rendering. Fixes Altinity#1919
sunsingerus
left a comment
There was a problem hiding this comment.
PR includes modified files that are auto-generated and no modifications to the generator itself
Address review: the previous change hand-edited the generated ConfigMap-etc-clickhouse-operator-files.yaml. Instead, special-case the etc-clickhouse-operator-files ConfigMap in update_configmap_resource() so generate_helm_chart.sh emits the configmap-files helper (which wires watchNamespaces into watch.namespaces.include). Re-running the generator now reproduces the committed template. README values table regenerated by helm-docs.
|
Thanks for the review — you're right. I've reworked it so the change comes from the generator, not the generated file.
Verified: default ( |
Problem
Closes #1919.
configs.files.config.yaml.watch.namespaces.includeis hardcoded to[]invalues.yamland the ConfigMap template renders it directly — there is no way to override it via a top-level Helm value. Users who need the operator to watch multiple namespaces must manually patch the ConfigMap after install, which is fragile and breaks on upgrades.Solution
This PR introduces:
watchNamespacesvalue invalues.yaml(empty by default — preserves existing behavior):A new
altinity-clickhouse-operator.configmap-fileshelper in_helpers.tplthat deep-copiesconfigs.files, patcheswatch.namespaces.includein-place, and delegates to the existingconfigmap-datahelper for rendering.The ConfigMap template updated to call the new helper instead of
configmap-datadirectly.Usage
Or via
--set:helm install clickhouse-operator altinity/altinity-clickhouse-operator \ --set "watchNamespaces={clickhouse-system,my-app-namespace}"Behavior
watchNamespaces: [](default) — no change, operator watches its own namespacewatchNamespaces: [".*"]— watch all namespacesTesting