fix: chartifyOpts ignore release set values (#896)

* fix: chartifyOpts ignore release set values

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2023-06-13 23:28:27 +08:00 committed by GitHub
parent df01973824
commit afcc9e4b80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View File

@ -1224,11 +1224,13 @@ func (st *HelmState) PrepareCharts(helm helmexec.Interface, dir string, concurre
chartifyOpts.KubeVersion = release.KubeVersion chartifyOpts.KubeVersion = release.KubeVersion
chartifyOpts.ApiVersions = release.ApiVersions chartifyOpts.ApiVersions = release.ApiVersions
// https://github.com/helmfile/helmfile/pull/867
// https://github.com/helmfile/helmfile/issues/895
var flags []string var flags []string
for _, s := range opts.Set { for _, s := range opts.Set {
flags = append(flags, "--set", s) flags = append(flags, "--set", s)
} }
chartifyOpts.SetFlags = flags chartifyOpts.SetFlags = append(chartifyOpts.SetFlags, flags...)
out, err := c.Chartify(release.Name, chartPath, chartify.WithChartifyOpts(chartifyOpts)) out, err := c.Chartify(release.Name, chartPath, chartify.WithChartifyOpts(chartifyOpts))
if err != nil { if err != nil {

View File

@ -11,4 +11,6 @@ releases:
- path: "/spec/strategy/type" - path: "/spec/strategy/type"
op: replace op: replace
value: Recreate value: Recreate
set:
- name: image.pullPolicy
value: Always

View File

@ -45,7 +45,7 @@ spec:
spec: spec:
containers: containers:
- image: docker.io/citizenstig/httpbin:latest - image: docker.io/citizenstig/httpbin:latest
imagePullPolicy: IfNotPresent imagePullPolicy: Always
livenessProbe: livenessProbe:
httpGet: httpGet:
path: / path: /

View File

@ -45,7 +45,7 @@ spec:
spec: spec:
containers: containers:
- image: docker.io/citizenstig/httpbin:v2 - image: docker.io/citizenstig/httpbin:v2
imagePullPolicy: IfNotPresent imagePullPolicy: Always
livenessProbe: livenessProbe:
httpGet: httpGet:
path: / path: /