Bug 2022124

Summary: Dynamic Plugins: useK8sWatchResource doesn't work for core resource using the groupVersionKind property
Product: OpenShift Container Platform Reporter: Samuel Padgett <spadgett>
Component: Management ConsoleAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED DUPLICATE QA Contact: Yadan Pei <yapei>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.10CC: aos-bugs, jhadvig, jokerman, kdoberst
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Version: 4.10.0-0.nightly-2021-11-09-181140 Cluster ID: b60dd994-0676-4a81-9cdd-a212351e3ecf Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.114 Safari/537.36
Last Closed: 2021-12-14 16:45:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Samuel Padgett 2021-11-10 19:42:32 UTC
The following code doesn't work:

  const [podsData, podsLoaded, podsError] = useK8sWatchResource<{}[]>({
      groupVersionKind: { version: 'v1', kind: 'Pod' },
      namespace: 'openshift-console',
      isList: true,
      namespaced: true,
  });

`useK8sWatchResource` calls `getReference` on `groupVersionKind`, which returns `core~v1~Pod`. However, the model key for Pods in `Pod` in Redux, so the watch hook doesn't find the model when calling `k8s.getIn(['RESOURCES', 'models', kindReference])`.

Comment 1 Kim Dobestein 2021-12-13 16:18:55 UTC
Putting this back into the "pool" so it can be re-triaged and reassigned.

Comment 2 Samuel Padgett 2021-12-14 16:45:35 UTC

*** This bug has been marked as a duplicate of bug 2027311 ***