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:
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
(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.
verified on kubevirt-console-plugin-rhel9:v4.14.0-2359
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