From 480846a312914d817997a90d6048927b5d0427b2 Mon Sep 17 00:00:00 2001 From: chowmean Date: Sun, 17 Mar 2019 00:13:31 +0530 Subject: [PATCH 1/4] adding option to override number of retries --- kubernetes/client/configuration.py | 2 ++ kubernetes/client/rest.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/kubernetes/client/configuration.py b/kubernetes/client/configuration.py index 647f6b8a51..6612a12235 100644 --- a/kubernetes/client/configuration.py +++ b/kubernetes/client/configuration.py @@ -106,6 +106,8 @@ def __init__(self): # Safe chars for path_param self.safe_chars_for_path_param = '' + self.retries = None + @property def logger_file(self): """ diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py index 1a755ee102..5711d0d172 100644 --- a/kubernetes/client/rest.py +++ b/kubernetes/client/rest.py @@ -80,6 +80,10 @@ def __init__(self, configuration, pools_size=4, maxsize=None): if configuration.assert_hostname is not None: addition_pool_args['assert_hostname'] = configuration.assert_hostname + + if hasattr(configuration, "retries") and configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + if maxsize is None: if configuration.connection_pool_maxsize is not None: maxsize = configuration.connection_pool_maxsize From e63b6c2eeb3f0f18d414ec1f61309968dc7e07f7 Mon Sep 17 00:00:00 2001 From: chowmean Date: Sun, 17 Mar 2019 00:15:30 +0530 Subject: [PATCH 2/4] removing unnecessary check --- kubernetes/client/rest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py index 5711d0d172..e32980c7d0 100644 --- a/kubernetes/client/rest.py +++ b/kubernetes/client/rest.py @@ -81,7 +81,7 @@ def __init__(self, configuration, pools_size=4, maxsize=None): addition_pool_args['assert_hostname'] = configuration.assert_hostname - if hasattr(configuration, "retries") and configuration.retries is not None: + if configuration.retries is not None: addition_pool_args['retries'] = configuration.retries if maxsize is None: From eb6ff0711bda8641997bd413d72ac6e33630f0ed Mon Sep 17 00:00:00 2001 From: chowmean Date: Sun, 17 Mar 2019 00:18:28 +0530 Subject: [PATCH 3/4] formating fix --- kubernetes/client/rest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py index e32980c7d0..aed316fd3c 100644 --- a/kubernetes/client/rest.py +++ b/kubernetes/client/rest.py @@ -80,7 +80,6 @@ def __init__(self, configuration, pools_size=4, maxsize=None): if configuration.assert_hostname is not None: addition_pool_args['assert_hostname'] = configuration.assert_hostname - if configuration.retries is not None: addition_pool_args['retries'] = configuration.retries From 8e37a914a5525575f589689a91e149ce830fd514 Mon Sep 17 00:00:00 2001 From: chowmean Date: Tue, 19 Mar 2019 10:21:16 +0530 Subject: [PATCH 4/4] adding documentation --- kubernetes/client/configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/client/configuration.py b/kubernetes/client/configuration.py index 6612a12235..eaa9ac3b23 100644 --- a/kubernetes/client/configuration.py +++ b/kubernetes/client/configuration.py @@ -105,7 +105,7 @@ def __init__(self): self.proxy_headers = None # Safe chars for path_param self.safe_chars_for_path_param = '' - + # Retires to override the default value os 3 retries in urllib3 self.retries = None @property