From afcc9e4b80c3de2dc70ecfb80984f73159ab2709 Mon Sep 17 00:00:00 2001 From: yxxhero <11087727+yxxhero@users.noreply.github.com> Date: Tue, 13 Jun 2023 23:28:27 +0800 Subject: [PATCH] fix: chartifyOpts ignore release set values (#896) * fix: chartifyOpts ignore release set values Signed-off-by: yxxhero --- pkg/state/state.go | 4 +++- test/integration/test-cases/chartify/input/helmfile.yaml | 4 +++- test/integration/test-cases/chartify/output/template | 2 +- test/integration/test-cases/chartify/output/template-set | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/state/state.go b/pkg/state/state.go index 69813ea2..fbaa7a66 100644 --- a/pkg/state/state.go +++ b/pkg/state/state.go @@ -1224,11 +1224,13 @@ func (st *HelmState) PrepareCharts(helm helmexec.Interface, dir string, concurre chartifyOpts.KubeVersion = release.KubeVersion chartifyOpts.ApiVersions = release.ApiVersions + // https://github.com/helmfile/helmfile/pull/867 + // https://github.com/helmfile/helmfile/issues/895 var flags []string for _, s := range opts.Set { flags = append(flags, "--set", s) } - chartifyOpts.SetFlags = flags + chartifyOpts.SetFlags = append(chartifyOpts.SetFlags, flags...) out, err := c.Chartify(release.Name, chartPath, chartify.WithChartifyOpts(chartifyOpts)) if err != nil { diff --git a/test/integration/test-cases/chartify/input/helmfile.yaml b/test/integration/test-cases/chartify/input/helmfile.yaml index d2285856..d6a8b10d 100644 --- a/test/integration/test-cases/chartify/input/helmfile.yaml +++ b/test/integration/test-cases/chartify/input/helmfile.yaml @@ -11,4 +11,6 @@ releases: - path: "/spec/strategy/type" op: replace value: Recreate - + set: + - name: image.pullPolicy + value: Always diff --git a/test/integration/test-cases/chartify/output/template b/test/integration/test-cases/chartify/output/template index 3424a8d0..8793b097 100644 --- a/test/integration/test-cases/chartify/output/template +++ b/test/integration/test-cases/chartify/output/template @@ -45,7 +45,7 @@ spec: spec: containers: - image: docker.io/citizenstig/httpbin:latest - imagePullPolicy: IfNotPresent + imagePullPolicy: Always livenessProbe: httpGet: path: / diff --git a/test/integration/test-cases/chartify/output/template-set b/test/integration/test-cases/chartify/output/template-set index 7e226a7c..f10eabf7 100644 --- a/test/integration/test-cases/chartify/output/template-set +++ b/test/integration/test-cases/chartify/output/template-set @@ -45,7 +45,7 @@ spec: spec: containers: - image: docker.io/citizenstig/httpbin:v2 - imagePullPolicy: IfNotPresent + imagePullPolicy: Always livenessProbe: httpGet: path: /