Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2055589

Summary: Templates are not shown in VM creation wizard but shown in Templates page for non-privileged user
Product: OpenShift Container Platform Reporter: Leon Kladnitsky <lkladnit>
Component: Console Kubevirt PluginAssignee: Matan Schatzman <mschatzm>
Status: CLOSED NOTABUG QA Contact: Guohua Ouyang <gouyang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.10CC: gouyang, tnisan
Target Milestone: ---   
Target Release: 4.10.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-08 02:45:26 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:
Bug Depends On: 2102302    
Bug Blocks:    
Attachments:
Description Flags
templates display inconsistency none

Description Leon Kladnitsky 2022-02-17 10:12:45 UTC
Created attachment 1861648 [details]
templates display inconsistency

Description of problem: 
Non-priviledged user can't select template in VM creation wizard, despite granted view role

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

How reproducible:
100%

Steps to Reproduce:
1. Allow acess to cluster for non-privileged user by applying the htpasswd idp:
https://github.com/openshift/console/blob/e4bd0786eb9232be1c2ea2194ae58f59a8be3f4d/test-prow-e2e.sh#L52
2. Grant non-privileged user view role to 'openshift', 'openshift-virtualization-os-images' and 'default' namespaces
$ oc adm policy add-role-to-user view test -n openshift
>> clusterrole.rbac.authorization.k8s.io/view added: "test"
$ oc adm policy add-role-to-user view test -n openshift-virtualization-os-images
>> clusterrole.rbac.authorization.k8s.io/view added: "test"
$ oc adm policy add-role-to-user view test -n default
>> clusterrole.rbac.authorization.k8s.io/view added: "test"

3. Login as test/test, switch to Admin Perspective
4. Open Virtualization -> Templates 
The templates are accessible, Create VM buttons work, VM can be created
5. Open Virtualization -> Virtual Machines, click 'Create virtual machine' button or 'Create' -> 'With wizard'

Actual results:
Templates are not available, Error message appears:
templates.template.openshift.io is forbidden: User "test" cannot list resource "templates" in API group "template.openshift.io" at the cluster scope

Expected results:
Templates are listed, wizard can continue

Additional info:

Comment 2 Guohua Ouyang 2022-08-08 02:45:26 UTC
This is not a bug of 4.10.z anymore, close it.