Skip to content

Commit 39d64f5

Browse files
fix: use the values managed file only if workload imageUpdateStrategy is set (#2806)
Co-authored-by: svcAPLBot <[email protected]>
1 parent 9e240c7 commit 39d64f5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

charts/team-ns/templates/argocd/argocd-application-workload.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{{- $v := .Values }}
2-
32
{{- range $v.workloads }}
3+
{{- $workload := . }}
4+
{{- $includeManagedValuesFile := false }}
5+
{{- if and $workload.imageUpdateStrategy $workload.imageUpdateStrategy.type }}
6+
{{- $includeManagedValuesFile = not (eq $workload.imageUpdateStrategy.type "disabled") }}
7+
{{- end }}
48
---
59
apiVersion: argoproj.io/v1alpha1
610
kind: Application
@@ -32,8 +36,10 @@ spec:
3236
{{- end }}
3337
{{- end }}
3438
valueFiles:
35-
- $values/env/teams/{{ $v.teamId }}/workloadValues/{{ .name }}.yaml
36-
- $values/env/teams/{{ $v.teamId }}/workloadValues/{{ .name }}.managed.yaml
39+
- $values/env/teams/{{ $v.teamId }}/workloadValues/{{ $workload.name }}.yaml
40+
{{- if $includeManagedValuesFile }}
41+
- $values/env/teams/{{ $v.teamId }}/workloadValues/{{ $workload.name }}.managed.yaml
42+
{{- end }}
3743
- repoURL: {{ $v.gitOps.workloadValuesRepoUrl | quote }}
3844
targetRevision: '{{ .revision }}'
3945
ref: values

tests/fixtures/env/teams/demo/workloads/wd3.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ metadata:
44
labels:
55
apl.io/teamId: demo
66
spec:
7-
imageUpdateStrategy:
8-
type: disabled
97
path: ./
108
revision: main
119
url: https://myrepo.local/mychart.git

0 commit comments

Comments
 (0)