karenbraganz commented on code in PR #68048:
URL: https://github.com/apache/airflow/pull/68048#discussion_r4041581849


##########
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py:
##########
@@ -1232,7 +1239,52 @@ def _poll_k8s_driver_via_api(self) -> str | None:
                         ) from e
                     time.sleep(poll_interval)
                     continue
-
+                driver_container = None
+
+                for container in pod.spec.containers:
+                    if kubernetes_driver_container_name:
+                        if kubernetes_driver_container_name.lower() == 
container.name.lower():
+                            driver_container = container
+                            break
+                        continue
+                    if "driver" in container.name.lower():
+                        driver_container = container
+                        break
+                    if "spark" in container.name.lower():
+                        driver_container = container
+                    if len(pod.spec.containers) == 1:
+                        driver_container = container
+                if kubernetes_driver_container_name and not driver_container:
+                    raise ValueError(
+                        f"The driver container name provided does not match 
any of the containers in pod {kubernetes_driver_pod_name}"
+                    )

Review Comment:
   This has been implemeted.



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

Reply via email to