Skip to content

Commit

Permalink
Revert "Update Kubernetes library version (#18797)"
Browse files Browse the repository at this point in the history
This reverts commit cb9cdf5.
  • Loading branch information
ashb authored and ephraimbuddy committed Mar 28, 2022
1 parent b48f614 commit 9bd5297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 2 additions & 6 deletions airflow/providers/cncf/kubernetes/utils/pod_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@
from airflow.utils.log.logging_mixin import LoggingMixin

if TYPE_CHECKING:
try:
# Kube >= 19
from kubernetes.client.models.core_v1_event_list import CoreV1EventList as V1EventList
except ImportError:
from kubernetes.client.models.v1_event_list import V1EventList
from kubernetes.client.models.core_v1_event_list import CoreV1EventList


class PodLaunchFailedException(AirflowException):
Expand Down Expand Up @@ -321,7 +317,7 @@ def read_pod_logs(
raise

@tenacity.retry(stop=tenacity.stop_after_attempt(3), wait=tenacity.wait_exponential(), reraise=True)
def read_pod_events(self, pod: V1Pod) -> "V1EventList":
def read_pod_events(self, pod: V1Pod) -> "CoreV1EventList":
"""Reads events from the POD"""
try:
return self._client.list_namespaced_event(
Expand Down
6 changes: 1 addition & 5 deletions tests/kubernetes/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,5 @@ def test_disable_verify_ssl(self):

_disable_verify_ssl()

# Support wide range of kube client libraries
if hasattr(Configuration, 'get_default_copy'):
configuration = Configuration.get_default_copy()
else:
configuration = Configuration()
configuration = Configuration()
self.assertFalse(configuration.verify_ssl)

0 comments on commit 9bd5297

Please sign in to comment.