Bug 2059674 - Demo plugin fails to build
Summary: Demo plugin fails to build
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.11.0
Assignee: Andrew Ballantyne
QA Contact: Xiyun Zhao
URL:
Whiteboard:
Depends On:
Blocks: 2055814
TreeView+ depends on / blocked
 
Reported: 2022-03-01 17:16 UTC by Samuel Padgett
Modified: 2022-08-10 10:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 10:51:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 11116 0 None open Bug 2059674: Adjusts the Dynamic Demo Plugin and the SDK to meet on the usecases 2022-03-01 20:55:00 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 10:51:50 UTC

Description Samuel Padgett 2022-03-01 17:16:03 UTC
I get the following type errors building the dynamic demo plugin:

$ cd dynamic-demo-plugin
$ yarn install
$ yarn run build

ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx
95:12-59
[tsl] ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(95,13)
      TS2345: Argument of type '{ model: K8sModel; queryParams: { ns: string; }; }' is not assignable to parameter of type 'OptionsList'.
  Property 'requestInit' is missing in type '{ model: K8sModel; queryParams: { ns: string; }; }' but required in type 'OptionsList'.

ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx
97:21-29
[tsl] ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(97,22)
      TS2345: Argument of type 'K8sResourceCommon[] | (K8sResourceCommon & { items: K8sResourceCommon[]; })' is not assignable to parameter of type 'SetStateAction<K8sResourceCommon[]>'.
  Type 'K8sResourceCommon & { items: K8sResourceCommon[]; }' is not assignable to type 'SetStateAction<K8sResourceCommon[]>'.
    Type 'K8sResourceCommon & { items: K8sResourceCommon[]; }' is not assignable to type '(prevState: K8sResourceCommon[]) => K8sResourceCommon[]'.
      Type 'K8sResourceCommon & { items: K8sResourceCommon[]; }' provides no match for the signature '(prevState: K8sResourceCommon[]): K8sResourceCommon[]'.

ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx
107:14-60
[tsl] ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(107,15)
      TS2345: Argument of type '{ model: K8sModel; resource: { apiVersion: string; kind: string; metadata: { name: string; namespace: string; labels: { app: string; }; }; spec: { selector: { matchLabels: { app: string; }; }; replicas: number; template: { ...; }; }; }; }' is not assignable to parameter of type 'OptionsDelete<{ apiVersion: string; kind: string; metadata: { name: string; namespace: string; labels: { app: string; }; }; spec: { selector: { matchLabels: { app: string; }; }; replicas: number; template: { metadata: { labels: { ...; }; }; spec: { ...; }; }; }; }>'.
  Type '{ model: K8sModel; resource: { apiVersion: string; kind: string; metadata: { name: string; namespace: string; labels: { app: string; }; }; spec: { selector: { matchLabels: { app: string; }; }; replicas: number; template: { ...; }; }; }; }' is missing the following properties from type '{ model: K8sModel; resource: { apiVersion: string; kind: string; metadata: { name: string; namespace: string; labels: { app: string; }; }; spec: { selector: { matchLabels: { app: string; }; }; replicas: number; template: { ...; }; }; }; requestInit: RequestInit; json: Record<...>; }': requestInit, json

Comment 1 Samuel Padgett 2022-03-01 17:27:47 UTC
Raising severity as the types look incorrect in the SDK.

Comment 3 Xiyun Zhao 2022-03-09 05:54:26 UTC
This bug has been verified on payload 4.11.0-0.nightly-2022-03-04-063157

Verification Steps:
1. Prepare(download) the newest code of console
2. Go to 'dynamic-demo-plugin' folder
   $ cd dynamic-demo-plugin
3. Execute below command, verified if it is able to build successfully
   $ yarn install
   $ yarn run build

Result:
3. The dynamic-demo-plugin is built successfully without any error

Comment 5 errata-xmlrpc 2022-08-10 10:51:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069


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