liyinan926 commented on a change in pull request #27520: [SPARK-30771][K8S] 
Avoid failed mount warning from kubernetes and support the optional mount.
URL: https://github.com/apache/spark/pull/27520#discussion_r377270019
 
 

 ##########
 File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientApplication.scala
 ##########
 @@ -127,15 +127,18 @@ private[spark] class Client(
         .pods()
         .withName(driverPodName)
         .watch(watcher)) { _ =>
-      val createdDriverPod = kubernetesClient.pods().create(resolvedDriverPod)
+      var createdDriverPod: Option[Pod] = None
       try {
         val otherKubernetesResources =
           resolvedDriverSpec.driverKubernetesResources ++ Seq(configMap)
-        addDriverOwnerReference(createdDriverPod, otherKubernetesResources)
         kubernetesClient.resourceList(otherKubernetesResources: 
_*).createOrReplace()
+        createdDriverPod = 
Some(kubernetesClient.pods().create(resolvedDriverPod))
+        addDriverOwnerReference(createdDriverPod.get, otherKubernetesResources)
 
 Review comment:
   This only adds the `OwnerReference` to the resource metadata to the local 
copies of the resources in memory, without updating the resources to the API 
server.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to