From 46a795e3dbf15a19407998013db37f4de9a4bdc9 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Thu, 7 Nov 2024 10:53:12 +0800 Subject: [PATCH] Fix: unable to set cleanPodPolicy to All when submitting TFJob (#1191) Signed-off-by: Yi Chen --- charts/tfjob/templates/tfjob.yaml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/charts/tfjob/templates/tfjob.yaml b/charts/tfjob/templates/tfjob.yaml index 4bb29a9de..a1e1f25c4 100644 --- a/charts/tfjob/templates/tfjob.yaml +++ b/charts/tfjob/templates/tfjob.yaml @@ -1,7 +1,6 @@ {{- $gpuCount := .Values.gpuCount -}} {{- $psGpuCount := .Values.psGPU -}} {{- $syncMode := .Values.syncMode -}} -{{- $cleanPodPolicy := .Values.cleanPodPolicy -}} {{- $dataDirs := .Values.dataDirs -}} {{- $tfNodeSelectors :=.Values.tfNodeSelectors -}} apiVersion: "kubeflow.org/v1" @@ -24,8 +23,8 @@ metadata: spec: {{- if .Values.trainingOperatorCRD }} runPolicy: - {{- if .Values.cleanPodPolicy }} - cleanPodPolicy: {{ .Values.cleanPodPolicy }} + {{- with .Values.cleanPodPolicy }} + cleanPodPolicy: {{ . }} {{- end }} {{- if .Values.activeDeadlineSeconds }} activeDeadlineSeconds: {{ .Values.activeDeadlineSeconds }} @@ -34,13 +33,8 @@ spec: ttlSecondsAfterFinished: {{ .Values.ttlSecondsAfterFinished }} {{- end }} {{- else }} - {{- if .Values.cleanPodPolicy }} - {{- if eq "None" $cleanPodPolicy }} - cleanPodPolicy: None - {{- end }} - {{- if eq "Running" $cleanPodPolicy }} - cleanPodPolicy: Running - {{- end }} + {{- with .Values.cleanPodPolicy }} + cleanPodPolicy: {{ . }} {{- end }} {{- if .Values.activeDeadlineSeconds }} activeDeadlineSeconds: {{ .Values.activeDeadlineSeconds }}