diff --git a/Chart.yaml b/Chart.yaml index 7050640..35e19e3 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -3,7 +3,7 @@ description: A Helm chart to create per-clustergroup ArgoCD applications and any keywords: - pattern name: clustergroup -version: 0.9.47 +version: 0.9.48 home: https://github.com/validatedpatterns/clustergroup-chart maintainers: - name: Validated Patterns Team diff --git a/README.md b/README.md index e26aa94..6100aa9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # clustergroup -![Version: 0.9.47](https://img.shields.io/badge/Version-0.9.47-informational?style=flat-square) +![Version: 0.9.48](https://img.shields.io/badge/Version-0.9.48-informational?style=flat-square) A Helm chart to create per-clustergroup ArgoCD applications and any required namespaces or subscriptions. @@ -8,6 +8,8 @@ This chart is used to set up the basic building blocks in [Validated Patterns](h ### Notable changes +* v0.9.48: Templates in override values now render +* v0.9.45: Default value of `resourceTrackingMethod` is now `annotation` * v0.9.44: Default value of `resourceTrackingMethod` is now `annotation` * v0.9.43: Add support to `env`, `volumes` and `volumeMounts` in repository server * v0.9.38: Ensure sharedValueFiles and extraValueFiles are always prefixed with $patternref diff --git a/README.md.gotmpl b/README.md.gotmpl index 454ab1b..22983df 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -9,6 +9,8 @@ This chart is used to set up the basic building blocks in [Validated Patterns](h ### Notable changes +* v0.9.48: Templates in override values now render +* v0.9.45: Default value of `resourceTrackingMethod` is now `annotation` * v0.9.44: Default value of `resourceTrackingMethod` is now `annotation` * v0.9.43: Add support to `env`, `volumes` and `volumeMounts` in repository server * v0.9.38: Ensure sharedValueFiles and extraValueFiles are always prefixed with $patternref diff --git a/templates/plumbing/applications.yaml b/templates/plumbing/applications.yaml index 40a0e1f..8d6f5bc 100644 --- a/templates/plumbing/applications.yaml +++ b/templates/plumbing/applications.yaml @@ -81,7 +81,7 @@ spec: {{- end }} {{- range .overrides }} - name: {{ .name }} - value: {{ .value | quote }} + value: {{ tpl .value $ | quote }} {{- if .forceString }} forceString: true {{- end }} @@ -154,7 +154,7 @@ spec: {{- end }} {{- range .overrides }} - name: {{ .name }} - value: {{ .value | quote }} + value: {{ tpl .value $ | quote }} {{- if .forceString }} forceString: true {{- end }} diff --git a/tests/application_override_test.yaml b/tests/application_override_test.yaml new file mode 100644 index 0000000..54c58ac --- /dev/null +++ b/tests/application_override_test.yaml @@ -0,0 +1,103 @@ +suite: Test application helm overrides +templates: + - templates/plumbing/applications.yaml +release: + name: release-test +tests: + - it: should add override parameters on multisource applications + set: + global: + repoURL: https://github.com/validatedpatterns/multicloud-gitops + multiSourceRepoUrl: https://charts.validatedpatterns.io + clusterGroup: + applications: + acm: + name: acm + namespace: open-cluster-management + project: hub + chart: acm + chartVersion: 0.1.* + overrides: + - name: test_override + value: test_value + asserts: + - hasDocuments: + count: 1 + - contains: + path: spec.sources[1].helm.parameters + content: + name: test_override + value: test_value + + - it: should add override parameters on single-source applications + set: + clusterGroup: + applications: + test-app: + name: test-app + namespace: test-ns + project: default + path: charts/test + overrides: + - name: test_override + value: test_value + asserts: + - hasDocuments: + count: 1 + - contains: + path: spec.source.helm.parameters + content: + name: test_override + value: test_value + + - it: should add forceString on override when specified + set: + global: + repoURL: https://github.com/validatedpatterns/multicloud-gitops + multiSourceRepoUrl: https://charts.validatedpatterns.io + clusterGroup: + applications: + acm: + name: acm + namespace: open-cluster-management + project: hub + chart: acm + chartVersion: 0.1.* + overrides: + - name: test_override + value: test_value + forceString: true + asserts: + - hasDocuments: + count: 1 + - contains: + path: spec.sources[1].helm.parameters + content: + name: test_override + value: test_value + forceString: true + + - it: should render tpl in override value using global.repoURL + set: + global: + repoURL: https://github.com/validatedpatterns/multicloud-gitops + multiSourceRepoUrl: https://charts.validatedpatterns.io + clusterGroup: + applications: + acm: + name: acm + namespace: open-cluster-management + project: hub + chart: acm + chartVersion: 0.1.* + overrides: + - name: test_override + value: "{{ .Values.global.repoURL }}" + asserts: + - hasDocuments: + count: 1 + - contains: + path: spec.sources[1].helm.parameters + content: + name: test_override + value: https://github.com/validatedpatterns/multicloud-gitops