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 2022/01/05 21:11:45 UTC

[GitHub] [airflow] jedcunningham commented on a change in pull request #19949: Only update label when adopting to prevent new pods

jedcunningham commented on a change in pull request #19949:
URL: https://github.com/apache/airflow/pull/19949#discussion_r779139138



##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -737,7 +737,7 @@ def _adopt_completed_pods(self, kube_client: client.CoreV1Api) -> None:
                 kube_client.patch_namespaced_pod(
                     name=pod.metadata.name,
                     namespace=pod.metadata.namespace,
-                    body=PodGenerator.serialize_pod(pod),
+                    body={"metadata": {"labels": {"airflow-worker": pod.metadata.labels['airflow-worker']}}},

Review comment:
       Maybe we shouldn't mutate `pod` above and either use a variable or call `make_safe_label_value` here?




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