From b468f08a470a30d3368431b943818c0ab5a8d675 Mon Sep 17 00:00:00 2001 From: Sylvain Desbureaux Date: Wed, 22 Jul 2020 17:47:06 +0200 Subject: Use Apps/v1 API Instead of old APIs, use Apps/v1 API so readiness can be used on v1.16+ clusters. Issue-ID: OOM-2519 Signed-off-by: Sylvain Desbureaux Change-Id: I428f32a500a6175653990c10fb8e6b6811dbc8e0 --- ready.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ready.py b/ready.py index 0640ed5..2195a49 100755 --- a/ready.py +++ b/ready.py @@ -56,8 +56,7 @@ configuration.ssl_ca_cert = cert configuration.api_key['authorization'] = token configuration.api_key_prefix['authorization'] = 'Bearer' coreV1Api = client.CoreV1Api(client.ApiClient(configuration)) -api_instance = client.ExtensionsV1beta1Api(client.ApiClient(configuration)) -api = client.AppsV1beta1Api(client.ApiClient(configuration)) +api = client.AppsV1(client.ApiClient(configuration)) batchV1Api = client.BatchV1Api(client.ApiClient(configuration)) @@ -158,7 +157,7 @@ def wait_for_daemonset_complete(daemonset_name): """ complete = False try: - response = api_instance.read_namespaced_daemon_set( + response = api.read_namespaced_daemon_set( daemonset_name, namespace) status = response.status if status.desired_number_scheduled == status.number_ready: @@ -240,8 +239,8 @@ def get_deployment_name(replicaset): Returns: the name of the Deployment owning the ReplicatSet """ - api_response = api_instance.read_namespaced_replica_set_status(replicaset, - namespace) + api_response = api.read_namespaced_replica_set_status(replicaset, + namespace) deployment_name = read_name(api_response) return deployment_name -- cgit 1.2.3-korg