uros-b commented on code in PR #58730:
URL: https://github.com/apache/spark/pull/58730#discussion_r3987838331


##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesVolumeUtils.scala:
##########
@@ -133,6 +133,16 @@ object KubernetesVolumeUtils {
           options(pathKey),
           options(serverKey))
 
+      case KUBERNETES_VOLUMES_CSI_TYPE =>
+        val driverNameKey =
+          
s"$volumeType.$volumeName.$KUBERNETES_VOLUMES_OPTIONS_CSI_DRIVER_NAME_KEY"
+        val volumeConfPrefix = s"$volumeType.$volumeName.options."
+        val attributes = options.filter { case (k, v) => 
k.startsWith(volumeConfPrefix) }
+          .map { case (k, v) => (k.substring(volumeConfPrefix.length), v) }
+        KubernetesCSIVolumeConf(
+          options(driverNameKey),

Review Comment:
   KubernetesVolumeUtils.scala (CSI case) + missing KubernetesVolumeUtilsSuite 
coverage — the parse path does options(driverNameKey) directly, skipping the 
verifyOptionKey(...) guard that every sibling type uses to produce the " is 
required for " message (the deliberate SPARK-33063 improvement). A missing 
csiDriverName therefore throws a raw NoSuchElementException: key not found: ... 
instead of the friendly, type-named message. Compounding this, 
KubernetesVolumeUtilsSuite — which has both a happy-path parse test and a 
"Fails on missing option key" test for hostPath/emptyDir/nfs/pvc — gets no CSI 
test at all; the only new test lives in MountVolumesFeatureStepSuite. Add a 
verifyOptionKey guard for csiDriverName and a KubernetesVolumeUtilsSuite case 
(happy path + missing driver name) to match the sibling convention.



-- 
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