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

kubernetes.client.Configuration.set_default is not working as expected #2202

Open
DARSHAN-THE-CODER opened this issue Feb 29, 2024 · 4 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@DARSHAN-THE-CODER
Copy link

DARSHAN-THE-CODER commented Feb 29, 2024

What happened (please include outputs or screenshots):
configuraa = client.Configuration()
configuraa.retries = 1
client.Configuration.set_default(configuraa)
Here, I am trying to override retries value from 3 to 1.
This is from the source code ->
Screenshot 2024-03-01 at 12 30 58 AM

But I found that , you are not receiving that parameter here ->
Screenshot 2024-03-01 at 12 32 19 AM

What you expected to happen:
Expected behaviour -> User should be able to override max retry times incase cluster is not reachable
How to reproduce it (as minimally and precisely as possible):
Try to reach any cluster which doesnt exist properly from the above code
Anything else we need to know?:
After a long time, this error is printed , Which takes literally a lot of time ! and get this error message
Screenshot 2024-03-01 at 12 46 08 AM

Environment:

  • Kubernetes version (kubectl version) : Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.14") , Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.9-gke.1092000"
  • OS (e.g., MacOS 10.13.6): linux/amd64
  • Python version (python --version) : Python 3.6.8
  • Python client version (pip list | grep kubernetes): kubernetes 26.1.0
@DARSHAN-THE-CODER DARSHAN-THE-CODER added the kind/bug Categorizes issue or PR as related to a bug. label Feb 29, 2024
@showjason
Copy link
Contributor

Hi, here rest.py is the right code receiving the parameter retries.

@roycaihw
Copy link
Member

/assign @showjason

@DARSHAN-THE-CODER
Copy link
Author

Hi, here rest.py is the right code receiving the parameter retries.

It is not working, as in even retries is not getting applied

@showjason
Copy link
Contributor

Hi, here rest.py is the right code receiving the parameter retries.

It is not working, as in even retries is not getting applied

please try the following code:

from kubernetes import client, config

conf = client.Configuration()
conf.retries = 3
config.load_kube_config(client_configuration=conf)
client.Configuration.set_default(conf)

v1 = client.CoreV1Api()

resp = v1.read_namespaced_pod("<pod_name>", "<namespace>")
print(resp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants