diff --git a/README.md b/README.md index d3965cec..30d71454 100644 --- a/README.md +++ b/README.md @@ -175,12 +175,12 @@ helmfiles: # helmfile -f path/to/subhelmfile.yaml -l name=prometheus sync selectors: - name=prometheus - environment: - values: - # Environment values files merged into the nested state - - additiona.values.yaml - # Inline environment values merged into the nested state - - key1: val1 + # Override state values + values: + # Values files merged into the nested state's values + - additiona.values.yaml + # Inline state values merged into the nested state's values + - key1: val1 - # All the nested state files under `helmfiles:` is processed in the order of definition. # So it can be used for preparation for your main `releases`. An example would be creating CRDs required by `reelases` in the parent state file. path: path/to/mycrd.helmfile.yaml diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index 40f03dbd..5ab528db 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -664,15 +664,13 @@ func TestVisitDesiredStatesWithReleasesFiltered_EmbeddedNestedStateAdditionalEnv "/path/to/helmfile.yaml": ` helmfiles: - path: helmfile.d/a*.yaml - environment: - values: - - env.values.yaml + values: + - env.values.yaml - helmfile.d/b*.yaml - path: helmfile.d/c*.yaml - environment: - values: - - env.values.yaml - - tillerNs: INLINE_TILLER_NS_3 + values: + - env.values.yaml + - tillerNs: INLINE_TILLER_NS_3 `, "/path/to/helmfile.d/a1.yaml": ` environments: diff --git a/state/state.go b/state/state.go index e625b527..080aa9ba 100644 --- a/state/state.go +++ b/state/state.go @@ -1477,7 +1477,7 @@ func (hf *SubHelmfileSpec) UnmarshalYAML(unmarshal func(interface{}) error) erro Selectors []string `yaml:"selectors"` SelectorsInherited bool `yaml:"selectorsInherited"` - Environment SubhelmfileEnvironmentSpec `yaml:"environment"` + Environment SubhelmfileEnvironmentSpec `yaml:",inline"` } if err := unmarshal(&subHelmfileSpecTmp); err != nil { return err