Skip to content

Commit

Permalink
Added structured system yaml for xray
Browse files Browse the repository at this point in the history
  • Loading branch information
nxf5025 committed Nov 20, 2023
1 parent b087778 commit 5dcd687
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 3 deletions.
3 changes: 3 additions & 0 deletions stable/xray/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion stable/xray/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ name: xray
sources:
- https://github.com/jfrog/charts
type: application
version: 103.85.5
version: 103.86.0
14 changes: 14 additions & 0 deletions stable/xray/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
1 change: 1 addition & 0 deletions stable/xray/templates/_system-yaml-render.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- tpl .Values.xray.systemYaml . -}}
2 changes: 1 addition & 1 deletion stable/xray/templates/xray-system-yaml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ metadata:
type: Opaque
stringData:
system.yaml: |
{{ tpl .Values.xray.systemYaml . | indent 4 }}
{{ include "xray.calculatedSystemYaml" . | nindent 4 }}
{{- end }}
2 changes: 1 addition & 1 deletion stable/xray/templates/xray-unified-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions stable/xray/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5dcd687

Please sign in to comment.