kubernetes.client.AuthenticationV1TokenRequest() fails #2250
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
What happened (please include outputs or screenshots):
In documentation, the example given for api create_namespaced_service_account is not working due to:
body = kubernetes.client.V1ServiceAccount()
Traceback (most recent call last):
File "t.py", line 87, in
body = kubernetes.client.AuthenticationV1TokenRequest() # AuthenticationV1TokenRequest |
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/models/authentication_v1_token_request.py", line 70, in init
self.spec = spec
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/models/authentication_v1_token_request.py", line 160, in spec
raise ValueError("Invalid value for
spec
, must not beNone
") # noqa: E501ValueError: Invalid value for
spec
, must not beNone
(Nota: code indentation id wrong, but the issue is still there even while fixing it)
What you expected to happen:
The call to create_namespaced_service_account should work but the example is stuck before this call
How to reproduce it (as minimally and precisely as possible):
Copy paste example given : https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/CoreV1Api.md#create_namespaced_service_account_token
(adapt code to be connect to your cluster)
Anything else we need to know?:
I made a test with api list_namespace and list_namespaced_service_account they don't require call to AuthenticationV1TokenRequest and they are working well.
I presume that spec parameter should be set but I don't know what to set without a good example.
Environment:
kubectl version
): 1.29python --version
) 3.7pip list | grep kubernetes
) 26.1.0The text was updated successfully, but these errors were encountered: