Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new k8s client everytime to avoid token refresh issues #18

Merged
merged 2 commits into from
May 6, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/acktest/k8s/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ def load_and_create_resource(resource_directory: Path,

def _get_k8s_api_client() -> ApiClient:
global _k8s_api_client
if _k8s_api_client is None:
_k8s_api_client = config.new_client_from_config()
# Create new client everytime to avoid token refresh issues
# https://github.com/kubernetes-client/python/issues/741
# https://github.com/kubernetes-client/python-base/issues/125
_k8s_api_client = config.new_client_from_config()
return _k8s_api_client
surajkota marked this conversation as resolved.
Show resolved Hide resolved


Expand Down