Skip to content

Commit 8e2b346

Browse files
committed
feat: make it possible to pass YAML string as a global template
1 parent 372981b commit 8e2b346

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

charts/testkube-api/templates/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ spec:
203203
{{- if .Values.global.testWorkflows.globalTemplate.enabled }}
204204
{{- if .Values.global.testWorkflows.globalTemplate.inline }}
205205
- name: TESTKUBE_GLOBAL_WORKFLOW_TEMPLATE_INLINE
206+
{{- if and .Values.global.testWorkflows.globalTemplate.spec (kindIs "map" .Values.global.testWorkflows.globalTemplate.spec) }}
206207
value: {{ toJson .Values.global.testWorkflows.globalTemplate.spec | quote }}
208+
{{- else }}
209+
value: {{ toJson (fromYaml .Values.global.testWorkflows.globalTemplate.spec) | quote }}
210+
{{- end }}
207211
{{- else }}
208212
- name: TESTKUBE_GLOBAL_WORKFLOW_TEMPLATE_NAME
209213
value: "{{ .Values.global.testWorkflows.globalTemplate.name }}"

charts/testkube-api/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ global:
4040
external: false
4141
inline: false
4242
name: global-template
43-
spec: {}
43+
spec: null
4444

4545
### @section Common parameters
4646
## Kubernetes version (using Helm capabilities if not set)

charts/testkube/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ global:
6565
# -- Should the global template sourced inline instead of CRD? (otherwise its resource is created from spec below)
6666
inline: false
6767
# -- Specification for the global template
68-
spec: {}
68+
spec: null
6969
# spec:
7070
# pod:
7171
# imagePullSecrets:

0 commit comments

Comments
 (0)