From 1fafc70310c43d6c0e0c39c4e394eb286f490465 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Mon, 20 Nov 2023 15:00:31 -0500 Subject: [PATCH] Added structured system yaml for xray --- stable/xray/CHANGELOG.md | 3 +++ stable/xray/Chart.yaml | 2 +- stable/xray/templates/_helpers.tpl | 14 ++++++++++++++ stable/xray/templates/_system-yaml-render.tpl | 1 + stable/xray/templates/xray-system-yaml.yaml | 2 +- stable/xray/templates/xray-unified-secret.yaml | 2 +- stable/xray/values.yaml | 3 +++ 7 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 stable/xray/templates/_system-yaml-render.tpl diff --git a/stable/xray/CHANGELOG.md b/stable/xray/CHANGELOG.md index f895c1514..cdf5d9794 100644 --- a/stable/xray/CHANGELOG.md +++ b/stable/xray/CHANGELOG.md @@ -1,6 +1,9 @@ # JFrog Xray Chart Changelog All changes to this chart will be documented in this file. +## [103.86.0] - Nov 20,2023 +* Added the ability to provide a .Values.xray.structuredSystemYaml configuration which will merge with the existing .Values.xray.systemYaml + ## [103.85.5] - Sep 15,2023 * Fixed - Support to configure privateRegistry for pre-upgrade-hook diff --git a/stable/xray/Chart.yaml b/stable/xray/Chart.yaml index 6edd30228..5b74a1958 100644 --- a/stable/xray/Chart.yaml +++ b/stable/xray/Chart.yaml @@ -24,4 +24,4 @@ name: xray sources: - https://github.com/jfrog/charts type: application -version: 103.85.5 +version: 103.86.0 diff --git a/stable/xray/templates/_helpers.tpl b/stable/xray/templates/_helpers.tpl index 1b708e4a5..70ed07b79 100644 --- a/stable/xray/templates/_helpers.tpl +++ b/stable/xray/templates/_helpers.tpl @@ -616,3 +616,17 @@ Set xray env variables if rabbitmq.tls is enabled. - name: XRAY_CHART_SYSTEM_YAML_OVERRIDE_DATA_KEY value: "{{ .Values.systemYamlOverride.dataKey }}" {{- end }} + +{{/* +Calculate the systemYaml from structured and unstructured text input +*/}} +{{- define "xray.calculatedSystemYaml" -}} +{{ tpl (mergeOverwrite (include "xray.systemYaml" . | fromYaml) .Values.xray.structuredSystemYaml | toYaml) . }} +{{- end -}} + +{{/* +Calculate the systemYaml from the unstructured text input +*/}} +{{- define "xray.systemYaml" -}} +{{ include (print $.Template.BasePath "/_system-yaml-render.tpl") . }} +{{- end -}} diff --git a/stable/xray/templates/_system-yaml-render.tpl b/stable/xray/templates/_system-yaml-render.tpl new file mode 100644 index 000000000..66a362ebf --- /dev/null +++ b/stable/xray/templates/_system-yaml-render.tpl @@ -0,0 +1 @@ +{{- tpl .Values.xray.systemYaml . -}} diff --git a/stable/xray/templates/xray-system-yaml.yaml b/stable/xray/templates/xray-system-yaml.yaml index 47781db7c..64d045be0 100644 --- a/stable/xray/templates/xray-system-yaml.yaml +++ b/stable/xray/templates/xray-system-yaml.yaml @@ -11,5 +11,5 @@ metadata: type: Opaque stringData: system.yaml: | -{{ tpl .Values.xray.systemYaml . | indent 4 }} +{{ include "xray.calculatedSystemYaml" . | nindent 4 }} {{- end }} diff --git a/stable/xray/templates/xray-unified-secret.yaml b/stable/xray/templates/xray-unified-secret.yaml index 6fa086858..b86a08020 100644 --- a/stable/xray/templates/xray-unified-secret.yaml +++ b/stable/xray/templates/xray-unified-secret.yaml @@ -22,7 +22,7 @@ stringData: {{- if not .Values.systemYamlOverride.existingSecret }} system.yaml: | -{{ tpl .Values.xray.systemYaml . | nindent 4 }} +{{ include "xray.calculatedSystemYaml" . | nindent 4 }} {{- end }} data: diff --git a/stable/xray/values.yaml b/stable/xray/values.yaml index 310c24ec0..9fc74bdf9 100644 --- a/stable/xray/values.yaml +++ b/stable/xray/values.yaml @@ -239,6 +239,9 @@ xray: registry: {{ include "xray.getRegistryByService" (list . "exposures") }} image: {{ .Values.exposures.image.repository }} + # -- Additional structured values on top of the text based 'xray.systemYaml'. Applied after the text based config is evaluated for templates. Enables adding and modifying YAML elements in the evaulated 'xray.systemYaml'. + structuredSystemYaml: {} + # Sidecar containers for tailing Xray logs loggers: [] # - router-request.log