Bug 2224076 - Newly added API endpoints for virtualmachineinstances broke openshift-restclient-python [NEEDINFO]
Summary: Newly added API endpoints for virtualmachineinstances broke openshift-restcli...
Keywords:
Status: MODIFIED
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 4.15.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 4.15.0
Assignee: Debarati Basu-Nag
QA Contact: Kedar Bidarkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-19 18:00 UTC by Debarati Basu-Nag
Modified: 2023-08-03 09:10 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:
dbasunag: needinfo? (acardena)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CNV-31178 0 None None None 2023-07-19 18:01:48 UTC

Description Debarati Basu-Nag 2023-07-19 18:00:59 UTC
Description of problem: Four API endpoints were added recently: https://github.com/kubevirt/kubevirt/blame/9cf6dbb3e33c9ec9e9af8b18eb115c7fb9f7c311/pkg/virt-operator/resource/generate/rbac/cluster.go#L45-49. They broke openshift-restclient-python, which expects these end points to be of the format <a>/<b>
https://github.com/openshift/openshift-restclient-python/blob/master/openshift/dynamic/discovery.py#L133

This would block all test runs as we use openshift-restclient-python indirectly in cnv-tests for all api calls via openshift-python-wrapper.

Version-Release number of selected component (if applicable):
4.15.0

How reproducible:
100%

Steps to Reproduce:
1. https://main-jenkins-csb-cnvqe.apps.ocp-c1.prod.psi.redhat.com/view/cnv-tests%20runner/job/cnv-tests-runner-containerized/1599/console
2.
3.

Actual results:
12:15:59  INTERNALERROR>   File "/cnv-tests/.venv/lib/python3.9/site-packages/kubernetes/dynamic/discovery.py", line 269, in __search
12:15:59  INTERNALERROR>     resourcePart.resources = self.get_resources_for_api_version(
12:15:59  INTERNALERROR>   File "/cnv-tests/.venv/lib/python3.9/site-packages/openshift/dynamic/discovery.py", line 133, in get_resources_for_api_version
12:15:59  INTERNALERROR>     resource, name = subresource['name'].split('/')
12:15:59  INTERNALERROR> ValueError: too many values to unpack (expected 2)
=======================================
{'kind': '',
 'name': 'virtualmachineinstances/sev/fetchcertchain',
 'namespaced': True,
 'singularName': '',
 'verbs': None}, {'kind': '',
 'name': 'virtualmachineinstances/sev/querylaunchmeasurement',
 'namespaced': True,
 'singularName': '',
 'verbs': None}, {'kind': '',
 'name': 'virtualmachineinstances/sev/setupsession',
 'namespaced': True,
 'singularName': '',
 'verbs': None}, {'kind': '',
 'name': 'virtualmachineinstances/sev/injectlaunchsecret',
 'namespaced': True,
 'singularName': '',
 'verbs': None}

Expected results:


Additional info:
This would block all T2/smoke tests against 4.15.0

Comment 1 Kedar Bidarkar 2023-07-24 07:14:29 UTC
Assuming the version is a typo and updating it to 4.15.0

Comment 3 Antonio Cardace 2023-07-24 12:19:39 UTC
@dbasunag can the openshift-restclient-python be fixed instead? This looks like quite a hard limitation and would make the API weirder.

Is this just an implementation detail or is it mandated by OCP?

If you don't know the answer to these do you have a contact point?

Comment 7 Debarati Basu-Nag 2023-07-31 18:09:19 UTC
This is currently being addressed in https://github.com/openshift/openshift-restclient-python/pull/438 and https://github.com/kubernetes-client/python/pull/2095. Both are merged. With openshift-restclient-python 0.13.2, we are unblocked. I will wait for the release of kubernetes-client, to close it.


Note You need to log in before you can comment on or make changes to this bug.