mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-22 10:24:35 +02:00
Add MergeMapsWithArrayMerge and IsCLIOverride flag - WIP fixing array merging issue
Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
This commit is contained in:
co-authored by
yxxhero
parent
66751a845b
commit
1802fd4888
+3
-3
@@ -412,9 +412,9 @@ func (c *StateCreator) loadEnvValues(st *HelmState, name string, failOnMissingEn
|
||||
if overrode != nil {
|
||||
intOverrodeEnv := *newEnv
|
||||
|
||||
// Use MergeMaps instead of mergo.Merge to properly handle array merging element-by-element
|
||||
// This fixes issue #2281 where arrays were being replaced entirely instead of merged
|
||||
intOverrodeEnv.Values = maputil.MergeMaps(intOverrodeEnv.Values, overrode.Values)
|
||||
// Use MergeMapsWithArrayMerge instead of mergo.Merge to properly handle array merging element-by-element
|
||||
// This fixes issue #2281 where arrays from --state-values-set were being replaced entirely instead of merged
|
||||
intOverrodeEnv.Values = maputil.MergeMapsWithArrayMerge(intOverrodeEnv.Values, overrode.Values)
|
||||
|
||||
newEnv = &intOverrodeEnv
|
||||
}
|
||||
|
||||
@@ -150,6 +150,9 @@ type SubHelmfileSpec struct {
|
||||
// SubhelmfileEnvironmentSpec is the environment spec for a subhelmfile
|
||||
type SubhelmfileEnvironmentSpec struct {
|
||||
OverrideValues []any `yaml:"values,omitempty"`
|
||||
// CLISet is set internally to pass CLI overrides from --state-values-set
|
||||
// This is not part of the YAML spec
|
||||
CLISet map[string]any `yaml:"-"`
|
||||
}
|
||||
|
||||
// HelmSpec to defines helmDefault values
|
||||
|
||||
Reference in New Issue
Block a user