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 options to override command and args #1323

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions charts/renovate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ The following table lists the configurable parameters of the chart and the defau
| apiVersionOverrides.cronjob | string | `""` | String to override apiVersion of cronjob rendered by this helm chart |
| cronjob.activeDeadlineSeconds | string | `""` | Deadline for the job to finish |
| cronjob.annotations | object | `{}` | Annotations to set on the cronjob |
| cronjob.argsOverride | list | `[]` | Custom arguments to run in the container |
| cronjob.commandOverride | list | `[]` | Custom command to run in the container |
| cronjob.completionMode | string | `""` | "Where the jobs should be NonIndexed or Indexed" |
| cronjob.completions | string | `""` | "Number of successful completions is reached to mark the job as complete" |
| cronjob.concurrencyPolicy | string | `""` | "Allow" to allow concurrent runs, "Forbid" to skip new runs if a previous run is still running or "Replace" to replace the previous run |
Expand Down
11 changes: 10 additions & 1 deletion charts/renovate/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if or .Values.cronjob.preCommand .Values.cronjob.postCommand}}
{{- if or .Values.cronjob.commandOverride .Values.cronjob.argsOverride }}
{{- if .Values.cronjob.commandOverride }}
command:
{{- toYaml .Values.cronjob.commandOverride | nindent 16 }}
{{- end }}
{{- if .Values.cronjob.argsOverride }}
args:
{{- toYaml .Values.cronjob.argsOverride | nindent 16 }}
{{- end }}
viceice marked this conversation as resolved.
Show resolved Hide resolved
{{- else if or .Values.cronjob.preCommand .Values.cronjob.postCommand }}
viceice marked this conversation as resolved.
Show resolved Hide resolved
command: ["/bin/bash", "-c"]
args:
- |
Expand Down
4 changes: 4 additions & 0 deletions charts/renovate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ cronjob:
# image: INIT_CONTAINER_IMAGE
# -- Number of pods to run in parallel
parallelism: ''
# -- Custom command to run in the container
commandOverride: []
# -- Custom arguments to run in the container
argsOverride: []
# -- Prepend shell commands before renovate runs
preCommand: ''
# preCommand: |
Expand Down