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]>
(cherry picked from commit 763682d)
  • Loading branch information
ChenYi015 committed Dec 10, 2024
1 parent 833ba5c commit ea016d0
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 ea016d0

Please sign in to comment.