dongjoon-hyun commented on code in PR #48079:
URL: https://github.com/apache/spark/pull/48079#discussion_r1756994035
##########
resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/KubernetesVolumeUtilsSuite.scala:
##########
@@ -59,6 +59,37 @@ class KubernetesVolumeUtilsSuite extends SparkFunSuite {
KubernetesPVCVolumeConf("claimName"))
}
+ test("Parses persistentVolumeClaim volumes correctly with labels") {
+ val sparkConf = new SparkConf(false)
+ sparkConf.set("test.persistentVolumeClaim.volumeName.mount.path", "/path")
+ sparkConf.set("test.persistentVolumeClaim.volumeName.mount.readOnly",
"true")
+ sparkConf.set("test.persistentVolumeClaim.volumeName.options.claimName",
"claimName")
+ sparkConf.set("test.label.persistentVolumeClaim.volumeName.env", "test")
+ sparkConf.set("test.label.persistentVolumeClaim.volumeName.foo", "bar")
+
+ val volumeSpec = KubernetesVolumeUtils.parseVolumesWithPrefix(sparkConf,
"test.").head
+ assert(volumeSpec.volumeName === "volumeName")
+ assert(volumeSpec.mountPath === "/path")
+ assert(volumeSpec.mountReadOnly)
+ assert(volumeSpec.volumeConf.asInstanceOf[KubernetesPVCVolumeConf] ===
+ KubernetesPVCVolumeConf(claimName = "claimName",
+ labels = Map("env" -> "test", "foo" -> "bar")))
+ }
+
+ test("Parses persistentVolumeClaim volumes & puts labels as empty Map if not
provided") {
Review Comment:
Please add a test prefix.
--
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]