From 2b016c0a38bb168ece748586c028972031720bb1 Mon Sep 17 00:00:00 2001 From: Anthony Charrier Date: Fri, 10 Jan 2025 16:01:12 +0100 Subject: [PATCH] feat: add support for config.js --- charts/renovate/templates/config.yaml | 18 +++++++++++++----- charts/renovate/values.yaml | 3 +++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/charts/renovate/templates/config.yaml b/charts/renovate/templates/config.yaml index a791410df..fab7bb2f6 100644 --- a/charts/renovate/templates/config.yaml +++ b/charts/renovate/templates/config.yaml @@ -1,3 +1,10 @@ +{{- $configContent := "" }} +{{- if not .Values.renovate.configEnableHelmTpl }} + {{- $configContent = required "A valid .Values.renovate.config entry is required if existingConfigFile is not specified!" .Values.renovate.config | nindent 4 }} +{{- else }} + {{- $configContent = required "A valid .Values.renovate.config entry is required if existingConfigFile is not specified!" (tpl .Values.renovate.config .) | nindent 4 }} +{{- end }} + {{- if not .Values.renovate.existingConfigFile }} apiVersion: v1 {{- if .Values.renovate.configIsSecret }} @@ -15,10 +22,11 @@ stringData: {{- else }} data: {{- end }} +{{- if .Values.renovate.configIsJavascript }} + config.js: |- + {{ $configContent }} +{{- else }} config.json: |- - {{- if not .Values.renovate.configEnableHelmTpl }} - {{- required "A valid .Values.renovate.config entry is required if existingConfigFile is not specified!" .Values.renovate.config | nindent 4 }} - {{- else }} - {{- required "A valid .Values.renovate.config entry is required if existingConfigFile is not specified!" (tpl .Values.renovate.config .) | nindent 4 }} - {{- end }} + {{ $configContent }} +{{- end }} {{- end }} diff --git a/charts/renovate/values.yaml b/charts/renovate/values.yaml index 7baa7d3a0..a0480e5b1 100644 --- a/charts/renovate/values.yaml +++ b/charts/renovate/values.yaml @@ -113,6 +113,9 @@ renovate: # -- Use this to create the renovate-config as a secret instead of a configmap configIsSecret: false + # -- Use this to create a config.js instead of a config.json + configIsJavascript: false + # -- Renovate Container-level security-context securityContext: {}