Make job.ttl.enabled consistent and effective only when k8s >= 1.23 (#481)

This commit is contained in:
Lari Hotari 2024-03-26 06:23:15 -07:00 committed by GitHub
parent bc5862d4b0
commit eb0a878d9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -29,8 +29,8 @@ metadata:
spec: spec:
# This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond # This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond
# https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ # https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
{{- if .Values.job.ttl.enabled }} {{- if and .Values.job.ttl.enabled (semverCompare ">=1.23-0" .Capabilities.KubeVersion.Version) }}
ttlSecondsAfterFinished: {{ .Values.job.ttl.secondsAfterFinished }} ttlSecondsAfterFinished: {{ .Values.job.ttl.secondsAfterFinished | default 600 }}
{{- end }} {{- end }}
template: template:
spec: spec:

View File

@ -30,8 +30,8 @@ metadata:
spec: spec:
# This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond # This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond
# https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ # https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
{{- if .Values.job.ttl.enabled }} {{- if and .Values.job.ttl.enabled (semverCompare ">=1.23-0" .Capabilities.KubeVersion.Version) }}
ttlSecondsAfterFinished: {{ .Values.job.ttl.secondsAfterFinished }} ttlSecondsAfterFinished: {{ .Values.job.ttl.secondsAfterFinished | default 600 }}
{{- end }} {{- end }}
template: template:
spec: spec: