From 98e9d6ff0dfd116174eac98eb154f2b8eb0f8d15 Mon Sep 17 00:00:00 2001 From: EphraimBuddy Date: Fri, 23 Apr 2021 09:34:49 +0100 Subject: [PATCH] fixup! Handle kubernetes watcher stream disconnection --- airflow/executors/kubernetes_executor.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/airflow/executors/kubernetes_executor.py b/airflow/executors/kubernetes_executor.py index 9ab67acadcf58..0ecb4c14813d3 100644 --- a/airflow/executors/kubernetes_executor.py +++ b/airflow/executors/kubernetes_executor.py @@ -76,7 +76,13 @@ def __init__(self): class ResourceVersion(Borg): """Track resourceVersion from Kubernetes""" - def __init__(self, *, kube_client=None, namespace=None, resource_version=None): + def __init__( + self, + *, + kube_client: Optional[client.CoreV1Api] = None, + namespace: Optional[str] = None, + resource_version: Optional[str] = None, + ): Borg.__init__(self) if resource_version: # Update the state @@ -93,7 +99,7 @@ def _drop(cls): cls._shared_state = {} -def get_resource_version(kube_client: client.CoreV1Api, namespace): +def get_resource_version(kube_client: client.CoreV1Api, namespace: str): """ List pods to get the latest resource version