From cd0ecc52638bbfbae93f148a5a0cdb2ad544dab8 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Sat, 29 Aug 2020 15:01:22 +0900 Subject: [PATCH] Fix build error after `helmfile build --embed-values` addition This is a follow-up for #1436 --- pkg/app/app.go | 4 ++-- pkg/state/state.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index ea822a72..6547c912 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -391,7 +391,7 @@ 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 @@ -399,7 +399,7 @@ func (a *App) PrintState(c StateConfigProvider) error { 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 diff --git a/pkg/state/state.go b/pkg/state/state.go index 486a22b0..ecaf76a9 100644 --- a/pkg/state/state.go +++ b/pkg/state/state.go @@ -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 { @@ -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) }