From 2999546dc6f720dfa9e63f6060d357cf1ef94b89 Mon Sep 17 00:00:00 2001 From: "Cian (Keen) Gallagher" Date: Mon, 11 Nov 2024 02:13:15 +0000 Subject: [PATCH] Fix: should not add emptyDir sizeLimit conf on executor pods if it is nil (#2316) Signed-off-by: Cian Gallagher --- .../controller/sparkapplication/submission.go | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/internal/controller/sparkapplication/submission.go b/internal/controller/sparkapplication/submission.go index c1cf8662a..3c2479591 100644 --- a/internal/controller/sparkapplication/submission.go +++ b/internal/controller/sparkapplication/submission.go @@ -840,20 +840,22 @@ func executorVolumeMountsOption(app *v1beta2.SparkApplication) ([]string, error) } switch volumeType { case common.VolumeTypeEmptyDir: - args = append( - args, - "--conf", - fmt.Sprintf( - "%s=%s", + if volume.EmptyDir.SizeLimit != nil { + args = append( + args, + "--conf", fmt.Sprintf( - common.SparkKubernetesExecutorVolumesOptionsTemplate, - common.VolumeTypeEmptyDir, - volume.Name, - "sizeLimit", + "%s=%s", + fmt.Sprintf( + common.SparkKubernetesExecutorVolumesOptionsTemplate, + common.VolumeTypeEmptyDir, + volume.Name, + "sizeLimit", + ), + volume.EmptyDir.SizeLimit.String(), ), - volume.EmptyDir.SizeLimit.String(), - ), - ) + ) + } case common.VolumeTypeHostPath: args = append( args,