Skip to content

get_resources_for_api_version() expects sub-resource names to be of the format a/b #2091

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

Closed
dbasunag opened this issue Jul 26, 2023 · 1 comment · Fixed by #2095
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@dbasunag
Copy link
Contributor

dbasunag commented Jul 26, 2023

What happened (please include outputs or screenshots):
get_resources_for_api_version() in https://github.com/kubernetes-client/python/blob/master/kubernetes/base/dynamic/discovery.py#L173, currently expects sub-resource names to be of the format a/b. This does not work with newly added apis in kubevirt which are of the format a/b/c. https://github.com/kubevirt/kubevirt/blame/9cf6dbb3e33c9ec9e9af8b18eb115c7fb9f7c311/pkg/virt-operator/resource/generate/rbac/cluster.go#L45-49

14:46:39  INTERNALERROR>   File "/cnv-tests/.venv/lib/python3.9/site-packages/kubernetes/dynamic/discovery.py", line 173, in get_resources_for_api_version
14:46:39  INTERNALERROR>     resource, name = subresource['name'].split('/')
14:46:39  INTERNALERROR> ValueError: too many values to unpack (expected 2)

What you expected to happen:
Are the sub-resource names supposed to be restricted to this a/b format because of any kubernetes or openshift restrictions? If not can we remove this restrictions?
How to reproduce it (as minimally and precisely as possible):
Check with any subresources with the format of virtualmachineinstances/sev/fetchcertchain
Anything else we need to know?:

Environment:

  • Kubernetes version (kubectl version): 1.27
  • OS (e.g., MacOS 10.13.6): linux
  • Python version (python --version): 3.9
  • Python client version (pip list | grep kubernetes): 26.1.0
@dbasunag dbasunag added the kind/bug Categorizes issue or PR as related to a bug. label Jul 26, 2023
@dbasunag
Copy link
Contributor Author

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

Successfully merging a pull request may close this issue.

1 participant