dongjoon-hyun opened a new pull request, #58716:
URL: https://github.com/apache/spark/pull/58716

   ### What changes were proposed in this pull request?
   
   This PR aims to use `VolumeBuilder.withNewEmptyDir()` instead of 
`EmptyDirVolumeSourceBuilder` in `MountVolumesFeatureStep`.
   
   ```scala
            case KubernetesEmptyDirVolumeConf(medium, sizeLimit) =>
              new VolumeBuilder()
   -            .withEmptyDir(
   -              new EmptyDirVolumeSourceBuilder()
   -                .withMedium(medium.getOrElse(""))
   -                .withSizeLimit(sizeLimit.map(new Quantity(_)).orNull)
   -                .build())
   +            .withNewEmptyDir()
   +              .withMedium(medium.getOrElse(""))
   +              .withSizeLimit(sizeLimit.map(new Quantity(_)).orNull)
   +            .endEmptyDir()
   ```
   
   ### Why are the changes needed?
   
   `EmptyDirVolumeSourceBuilder` was introduced recently by SPARK-59384 
(#58671). The `kubernetes-client` 7.9.0 upgrade changed the constructor of 
`EmptyDirVolumeSource`, which broke the positional constructor call.
   
   The nested fluent API of `VolumeBuilder` does the same thing without 
referring to `EmptyDirVolumeSourceBuilder` directly. It is also the existing 
style in the same module. For example, `LocalDirsFeatureStep` already uses 
`withNewEmptyDir()` and `endEmptyDir()`. Like the builder, it doesn't depend on 
the constructor signature of `EmptyDirVolumeSource`.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. The generated `EmptyDirVolumeSource` is the same because 
`EmptyDirNested` and `EmptyDirVolumeSourceBuilder` share the same 
`EmptyDirVolumeSourceFluent`.
   
   ### How was this patch tested?
   
   Pass the CIs with the existing test coverage.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to