Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for config.js #2214

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/renovate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ The following table lists the configurable parameters of the chart and the defau
| redis.nameOverride | string | `""` | Override the prefix of the redisHost |
| renovate.config | string | `""` | Inline global renovate config.json |
| renovate.configEnableHelmTpl | bool | `false` | Use the Helm tpl function on your configuration. See README for how to use this value |
| renovate.configIsJavaScript | bool | `false` | Use this to create a config.js instead of a config.json |
| renovate.configIsSecret | bool | `false` | Use this to create the renovate-config as a secret instead of a configmap |
| renovate.existingConfigFile | string | `""` | Custom exiting global renovate config |
| renovate.persistence | object | `{"cache":{"enabled":false,"labels":{},"storageClass":"","storageSize":"512Mi","volumeName":""}}` | Options related to persistence |
Expand Down
18 changes: 13 additions & 5 deletions charts/renovate/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Comment on lines +1 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would prefer to compute the filename here, so you've less changes


{{- if not .Values.renovate.existingConfigFile }}
apiVersion: v1
{{- if .Values.renovate.configIsSecret }}
Expand All @@ -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 }}
3 changes: 3 additions & 0 deletions charts/renovate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}

Expand Down