Skip to content

Commit a63aa14

Browse files
authored
Merge pull request #91 from mbaldessari/fix-initcontainers
Fix initContainers variables
2 parents 80c6c9f + 06d2179 commit a63aa14

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

templates/plumbing/argocd.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ spec:
7272
name: trusted-hub-bundle
7373
- mountPath: /tmp/ca-bundles
7474
name: ca-bundles
75+
{{- if len $.Values.clusterGroup.argoCD.initContainers }}
76+
{{ toYaml $.Values.clusterGroup.argoCD.initContainers | indent 4 }}
77+
{{- end }}
7578
resources:
7679
limits:
7780
cpu: "1"
@@ -96,9 +99,6 @@ spec:
9699
name: trusted-hub-bundle
97100
- emptyDir: {}
98101
name: ca-bundles
99-
{{- if len $.Values.clusterGroup.argoCD.initContainers }}
100-
{{ $.Values.clusterGroup.argoCD.initContainers | toPrettyJson }}
101-
{{- end }}
102102
{{- if len $.Values.clusterGroup.argoCD.configManagementPlugins }}
103103
sidecarContainers:
104104
{{- range $cmp := $.Values.clusterGroup.argoCD.configManagementPlugins }}

tests/argocd_test.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,26 @@ tests:
180180
kinds:
181181
- Foo
182182
- Baz
183+
184+
- it: should render custom initContainers correctly
185+
set:
186+
clusterGroup:
187+
argoCD:
188+
initContainers:
189+
- command:
190+
- bash
191+
- -c
192+
- echo
193+
image: test
194+
name: test
195+
documentIndex: 0
196+
asserts:
197+
- contains:
198+
path: spec.repo.initContainers
199+
content:
200+
command:
201+
- bash
202+
- -c
203+
- echo
204+
image: test
205+
name: test

0 commit comments

Comments
 (0)