Skip to content

Commit

Permalink
Fix: should not add emptyDir sizeLimit conf if it is nil (kubeflow#2305)
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Chen <[email protected]>
  • Loading branch information
ChenYi015 authored Nov 4, 2024
1 parent 171e429 commit 763682d
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions internal/controller/sparkapplication/submission.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 763682d

Please sign in to comment.