Skip to content

Commit

Permalink
change the nest level of envvals overrides for nested state files(sub…
Browse files Browse the repository at this point in the history
…-helmfiles) (#635)

We added envvals overrides in the state file via #622 two days ago:

```
helmfiles:
- name: sub.helmfile.yaml
  environment:
    values:
    - mykey: myvalue
```

This change removes the `environment` level in the above cofig, so that it looks like:

```
helmfiles:
- name: sub.helmfile.yaml
  values:
  - mykey: myvalue
``

This is an inevitable breaking change towards #361. But I wanted to break it earlier so that less folks are affected.`

Ref #361 (comment)
  • Loading branch information
mumoshu authored Jun 1, 2019
1 parent 9318d8a commit 68b95f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 5 additions & 7 deletions pkg/app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 68b95f1

Please sign in to comment.