Skip to content

Commit

Permalink
Fix build error after helmfile build --embed-values addition
Browse files Browse the repository at this point in the history
This is a follow-up for #1436
  • Loading branch information
mumoshu committed Aug 29, 2020
1 parent dc6c59d commit cd0ecc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,15 @@ func (a *App) PrintState(c StateConfigProvider) error {
for i := range run.state.Releases {
r := run.state.Releases[i]

values, err := run.state.LoadYAMLForEmbedding(r.Values, r.MissingFileHandler, r.ValuesPathPrefix)
values, err := run.state.LoadYAMLForEmbedding(&r, r.Values, r.MissingFileHandler, r.ValuesPathPrefix)
if err != nil {
errs = []error{err}
return
}

run.state.Releases[i].Values = values

secrets, err := run.state.LoadYAMLForEmbedding(r.Secrets, r.MissingFileHandler, r.ValuesPathPrefix)
secrets, err := run.state.LoadYAMLForEmbedding(&r, r.Secrets, r.MissingFileHandler, r.ValuesPathPrefix)
if err != nil {
errs = []error{err}
return
Expand Down
4 changes: 2 additions & 2 deletions pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -2577,7 +2577,7 @@ func (st *HelmState) ToYaml() (string, error) {
}
}

func (st *HelmState) LoadYAMLForEmbedding(entries []interface{}, missingFileHandler *string, pathPrefix string) ([]interface{}, error) {
func (st *HelmState) LoadYAMLForEmbedding(release *ReleaseSpec, entries []interface{}, missingFileHandler *string, pathPrefix string) ([]interface{}, error) {
var result []interface{}

for _, v := range entries {
Expand All @@ -2598,7 +2598,7 @@ func (st *HelmState) LoadYAMLForEmbedding(entries []interface{}, missingFileHand
}
yamlOrTemplatePath := paths[0]

yamlBytes, err := st.RenderValuesFileToBytes(yamlOrTemplatePath)
yamlBytes, err := st.RenderReleaseValuesFileToBytes(release, yamlOrTemplatePath)
if err != nil {
return nil, fmt.Errorf("failed to render values files \"%s\": %v", t, err)
}
Expand Down

0 comments on commit cd0ecc5

Please sign in to comment.