From a07531b93233a9565d973d861dc711fa26b17cc8 Mon Sep 17 00:00:00 2001 From: Alexis Zamanis Date: Tue, 8 Nov 2022 16:52:57 +0200 Subject: [PATCH] Fix the refreshing of tokens from outside the cluster Requests from outside the cluster may have stale tokens and fail with status code `401`. Signed-off-by: Alexis Zamanis --- kubernetes/base/config/kube_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/base/config/kube_config.py b/kubernetes/base/config/kube_config.py index b959554481..f72890982f 100644 --- a/kubernetes/base/config/kube_config.py +++ b/kubernetes/base/config/kube_config.py @@ -575,7 +575,7 @@ def _set_config(self, client_configuration): def _refresh_api_key(client_configuration): if ('expiry' in self.__dict__ and _is_expired(self.expiry)): self._load_authentication() - self._set_config(client_configuration) + self._set_config(client_configuration) client_configuration.refresh_api_key_hook = _refresh_api_key # copy these keys directly from self to configuration object keys = ['host', 'ssl_ca_cert', 'cert_file', 'key_file', 'verify_ssl']