You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/05 14:43:40 UTC

[GitHub] [airflow] XD-DENG commented on a change in pull request #15204: BugFix: CLI 'kubernetes cleanup-pods' should only clean up Airflow-created Pods

XD-DENG commented on a change in pull request #15204:
URL: https://github.com/apache/airflow/pull/15204#discussion_r607127273



##########
File path: airflow/cli/commands/kubernetes_command.py
##########
@@ -91,9 +91,24 @@ def cleanup_pods(args):
     kube_client = get_kube_client()
     print(f'Listing pods in namespace {namespace}')
     list_kwargs = {"namespace": namespace, "limit": 500}
+    airflow_pod_labels = [
+        'airflow-worker',
+        'dag_id',
+        'task_id',
+        'execution_date',
+        'try_number',
+        'airflow_version',
+        'kubernetes_executor',
+    ]
     while True:  # pylint: disable=too-many-nested-blocks
         pod_list = kube_client.list_namespaced_pod(**list_kwargs)

Review comment:
       Definitely agree. Many thanks for the suggestion!
   
   Changes pushed.




-- 
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:
users@infra.apache.org