You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Owen-CH-Leung (via GitHub)" <gi...@apache.org> on 2023/09/23 07:50:07 UTC

[GitHub] [airflow] Owen-CH-Leung commented on a diff in pull request #34500: Fix Pod not being removed after istio-sidecar is removed

Owen-CH-Leung commented on code in PR #34500:
URL: https://github.com/apache/airflow/pull/34500#discussion_r1334939073


##########
airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -822,8 +823,12 @@ def process_pod_deletion(self, pod: k8s.V1Pod, *, reraise=True):
                     self.log.info("Deleting pod: %s", pod.metadata.name)
                     self.pod_manager.delete_pod(pod)
                 elif should_delete_pod and istio_enabled:
-                    self.log.info("Deleting istio-proxy sidecar inside %s: ", pod.metadata.name)
-                    self.kill_istio_sidecar(pod)
+                    if container_is_running(pod, self.ISTIO_CONTAINER_NAME):
+                        self.log.info("Deleting istio-proxy sidecar inside %s: ", pod.metadata.name)
+                        self.kill_istio_sidecar(pod)
+                        self.pod_manager.delete_pod(pod)
+                    else:
+                        self.pod_manager.delete_pod(pod)

Review Comment:
   hmmm yes. In my istio version I can see that `delete_namespaced_pod` works even when sidecar is running, and seems to me that we don't actually need to `kill_istio_sidecar` at all. However I'm not sure if this behaviour also applies to older version of istio. Shall we keep the logic to end istio sidecar followed by deleting the pod ? Or we should just go ahead to delete the pod directly 



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org