From 92bd59ef829cd1a2556b9115ac3fab221753b30e Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Mon, 4 Nov 2024 15:54:34 +0800 Subject: [PATCH] Fix: should not add emptyDir sizeLimit conf if it is nil Signed-off-by: Yi Chen --- .../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 d0bb6f578..c1cf8662a 100644 --- a/internal/controller/sparkapplication/submission.go +++ b/internal/controller/sparkapplication/submission.go @@ -502,20 +502,22 @@ func driverVolumeMountsOption(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.SparkKubernetesDriverVolumesOptionsTemplate, - common.VolumeTypeEmptyDir, - volume.Name, - "sizeLimit", + "%s=%s", + fmt.Sprintf( + common.SparkKubernetesDriverVolumesOptionsTemplate, + common.VolumeTypeEmptyDir, + volume.Name, + "sizeLimit", + ), + volume.EmptyDir.SizeLimit.String(), ), - volume.EmptyDir.SizeLimit.String(), - ), - ) + ) + } case common.VolumeTypeHostPath: args = append( args,