Skip to content

Commit

Permalink
fix(instant-chart): ensure CronJob renders correctly when the ‘starti…
Browse files Browse the repository at this point in the history
…ngDeadlineSeconds’ field is missing
  • Loading branch information
kimyvgy committed Nov 25, 2024
1 parent 6ce8ea4 commit 0baf89f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/instant-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
- general
- phelab
type: application
version: 0.5.1
version: 0.5.2
dependencies:
- name: common
version: 2.20.5
Expand Down
7 changes: 6 additions & 1 deletion charts/instant-chart/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ spec:
labels:
{{- include "instant-chart.labels" . | nindent 8 }}
spec:
{{- omit .Values.cronJob "schedule" "timeZone" "concurrencyPolicy" "startingDeadlineSeconds" | toYaml | nindent 6 }}
{{- $defaultValues := dict "schedule" nil "timeZone" nil "concurrencyPolicy" nil "startingDeadlineSeconds" nil -}}
{{- $job := merge $defaultValues .Values.cronJob -}}
{{- $job = omit $job "schedule" "timeZone" "concurrencyPolicy" "startingDeadlineSeconds" -}}
{{- with $job -}}
{{- . | toYaml | nindent 6 }}
{{- end }}
template:
{{- include "instant-chart.podTemplate" . | nindent 8 }}
{{- end }}
Expand Down
3 changes: 1 addition & 2 deletions charts/instant-chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,7 @@
"title": "Pod restart policy",
"description": "Restart policy for all containers within the pod",
"type": "string",
"enum": ["Always", "OnFailure", "Never", ""],
"default": "OnFailure"
"enum": ["Always", "OnFailure", "Never", ""]
},
"imagePatches": {
"additionalProperties": {
Expand Down

0 comments on commit 0baf89f

Please sign in to comment.