Skip to content

Commit

Permalink
bugfix: proper handling of values set to 0
Browse files Browse the repository at this point in the history
`if .Values.X` evaluates to false if X is defined to be 0.
This resulted in retryLimit and terminationGracePeriodSeconds
not being properly propagated through the the generated yaml
if the user sets their value to 0 (as opposed to nil).
  • Loading branch information
dgrove-oss committed Nov 11, 2024
1 parent aa6a58a commit 728f55f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/pytorchjob-generator/chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ annotations:


{{- define "mlbatch.schedulingSpec" }}
{{- if .Values.terminationGracePeriodSeconds }}
{{- if ne .Values.terminationGracePeriodSeconds nil }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}
{{- if .Values.bypassCoscheduler }}
Expand Down
2 changes: 1 addition & 1 deletion tools/pytorchjob-generator/chart/templates/appwrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ metadata:
{{- if .Values.retryPausePeriodDuration }}
workload.codeflare.dev.appwrapper/retryPausePeriodDuration: "{{ .Values.retryPausePeriodDuration }}"
{{- end }}
{{- if .Values.retryLimit }}
{{- if ne .Values.retryLimit nil }}
workload.codeflare.dev.appwrapper/retryLimit: "{{ .Values.retryLimit }}"
{{- end }}
{{- if .Values.forcefulDeletionGracePeriodDuration }}
Expand Down

0 comments on commit 728f55f

Please sign in to comment.