fix: use mergeOverwrite to properly override ConfigMap values

Fixes an issue where boolean values from bundle files were not being
properly overridden by values-<component> ConfigMap entries.

The Helm merge function has a bug when merging boolean values where
true from the first dict doesn't get overwritten by false from the
second dict. Using mergeOverwrite ensures ConfigMap values take
precedence over bundle values as intended.

Example:
- Bundle: autoDirectNodeRoutes: true
- ConfigMap values-cilium: autoDirectNodeRoutes: false
- Before: result was true (incorrect)
- After: result is false (correct)

This fix ensures that users can properly override any component
configuration using the values-<component> pattern in the cozystack
ConfigMap.

Signed-off-by: Denis Yudin <dyudin@intermedia.com>
This commit is contained in:
Denis Yudin
2025-09-04 12:13:22 +01:00
parent c0d5e52e65
commit 52d749d46a

View File

@@ -77,7 +77,7 @@ spec:
{{- $values = merge . $values }}
{{- end }}
{{- with index $cozyConfig.data (printf "values-%s" $x.name) }}
{{- $values = merge (fromYaml .) $values }}
{{- $values = mergeOverwrite $values (fromYaml .) }}
{{- end }}
{{- with $values }}
values: