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,