Bug 2192577 - Console errors while using a template without "parameters"
Summary: Console errors while using a template without "parameters"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 4.12.1
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.14.0
Assignee: Tal Nisan
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-02 10:57 UTC by nijin ashok
Modified: 2023-11-08 14:05 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-08 14:05:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
error while creating vm from template with no parameters on 4.14 (111.24 KB, image/png)
2023-05-15 01:45 UTC, Guohua Ouyang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CNV-28503 0 None None None 2023-05-02 10:58:12 UTC
Red Hat Knowledge Base (Solution) 7011627 0 None None None 2023-05-08 11:57:18 UTC
Red Hat Product Errata RHSA-2023:6817 0 None None None 2023-11-08 14:05:41 UTC

Description nijin ashok 2023-05-02 10:57:35 UTC
Description of problem:

Created a template without "parameters":

~~~
oc get template example -n default
NAME      DESCRIPTION           PARAMETERS    OBJECTS
example   VM template example   0 (all set)   1
~~~

Try creating a VM with this template.

Virtualization => Catalog => Select the template => Customize virtual machine

This fails with the error below:

~~~
Oh no! Something went wrong.

Stack trace:
TypeError: Cannot read properties of undefined (reading 'reduce')
    at https://console-openshift-console.apps.ocp4.shiftvirt.com/api/plugins/kubevirt-plugin/exposed-TemplatesCatalog-chunk.js:1385:82
    at jc (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:104246)
    at t.unstable_runWithPriority (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:262:3768)
    at Hi (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:44551)
    at Ec (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:103709)
    at https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:103620
    at N (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:262:2828)
    at C.port1.onmessage (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:262:1551)
~~~

Also, try templates => click on template => Parameters:

Fails with the error below:

~~~
Oh no! Something went wrong.

Stack trace:
TypeError: Cannot read properties of undefined (reading 'map')
    at TemplateParametersPage (https://console-openshift-console.apps.ocp4.shiftvirt.com/api/plugins/kubevirt-plugin/exposed-TemplateNavPage-chunk.js:4092:28)
    at na (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:58879)
    at Hs (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:111315)
    at wc (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:98327)
    at Cc (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:98255)
    at _c (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:98118)
    at pc (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:95105)
    at https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:44774
    at t.unstable_runWithPriority (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:262:3768)
    at Hi (https://console-openshift-console.apps.ocp4.shiftvirt.com/static/vendors~main-chunk-d016eb3bffbfe8cee1da.min.js:254:44551)
~~~

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

OpenShift Virtualization 4.12.2

How reproducible:

100 % 


Steps to Reproduce:

1. Create a template without parameters. 
2. Navigate to,

Virtualization => Catalog => Select the template => Customize virtual machine

and 

try templates => click on template => Parameters

The console fails with the above errors.

Actual results:

Console errors while using a template without "parameters"

Expected results:

The console shouldn't crash.

Additional info:

Comment 2 Guohua Ouyang 2023-05-15 01:45:09 UTC
Created attachment 1964556 [details]
error while creating vm from template with no parameters on 4.14

Did a test on 4.14 UI:
1. create the template from YAML
2. remove the parameter section in the yaml
3. create vm from this template in catalog
4. it pops up an error on "Customize Template parameters" step

Comment 3 Guohua Ouyang 2023-05-15 07:56:30 UTC
(In reply to Guohua Ouyang from comment #2)
> Created attachment 1964556 [details]
> error while creating vm from template with no parameters on 4.14
> 
> Did a test on 4.14 UI:
> 1. create the template from YAML
> 2. remove the parameter section in the yaml
> 3. create vm from this template in catalog
> 4. it pops up an error on "Customize Template parameters" step

The 'NAME' parameter is a required one, if keep or add the 'NAME' parameter in the template, the VM is created normally.

Comment 4 Guohua Ouyang 2023-08-01 10:16:55 UTC
verified on kubevirt-console-plugin-rhel9:v4.14.0-2359

Comment 6 errata-xmlrpc 2023-11-08 14:05:31 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 Virtualization 4.14.0 Images security and bug fix 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-2023:6817


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