summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-07-22 17:47:06 +0200
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-07-22 17:47:06 +0200
commitb468f08a470a30d3368431b943818c0ab5a8d675 (patch)
tree1473528f750bd522c229706731d92f0d876c50cc
parent7b09ee0e0f32d47e274589f26a8091aaa42af7f3 (diff)
Use Apps/v1 API3.0.0
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 <sylvain.desbureaux@orange.com> Change-Id: I428f32a500a6175653990c10fb8e6b6811dbc8e0
-rwxr-xr-xready.py9
1 files 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