pan3793 commented on code in PR #4625:
URL: https://github.com/apache/kyuubi/pull/4625#discussion_r1151551731


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala:
##########
@@ -127,22 +137,68 @@ class KubernetesApplicationOperation extends 
ApplicationOperation with Logging {
     }
   }
 
-  private def findDriverPodByTag(tag: String): util.List[Pod] = {
-    val podList = kubernetesClient.pods()
-      .withLabel(KubernetesApplicationOperation.LABEL_KYUUBI_UNIQUE_KEY, 
tag).list().getItems
-    val size = podList.size()
-    if (size != 1) {
-      warn(s"Get Tag: ${tag} Driver Pod In Kubernetes size: ${size}, we expect 
1")
+  override def stop(): Unit = {
+    try {
+      if (kubernetesClient != null) {
+        kubernetesClient.close()
+      }
+      if (driverInformer != null) {
+        driverInformer.stop()
+      }
+      if (deletedAppInfoCache != null) {
+        deletedAppInfoCache.cleanUp()
+      }
+    } catch {
+      case e: Exception => error(e.getMessage)
     }
-    podList
   }
 
-  override def stop(): Unit = {
-    if (kubernetesClient != null) {
-      try {
-        kubernetesClient.close()
-      } catch {
-        case e: Exception => error(e.getMessage)
+  class DriverPodEventHandler extends ResourceEventHandler[Pod] {
+    private def filter(pod: Pod): Boolean = {

Review Comment:
   the method name is confusing



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