Bug 1949019

Summary: PersistentVolumes page cannot sync project status automatically which will block user to create PV
Product: OpenShift Container Platform Reporter: Xiyun Zhao <xiyuzhao>
Component: Management ConsoleAssignee: Cyril <cajieh>
Status: CLOSED ERRATA QA Contact: Xiyun Zhao <xiyuzhao>
Severity: low Docs Contact:
Priority: low    
Version: 4.8CC: aos-bugs, jokerman, spadgett, yapei
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: Scrubbed
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Incorrect code Consequence: Normal users are blocked from creating PV. Fix: Enabled PV create button by default for normal users. Result: The create PV button is enabled by default and it doesn't depend on project status.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 22:59:58 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:
Attachments:
Description Flags
Create PersistentVolumes none

Description Xiyun Zhao 2021-04-13 09:14:37 UTC
Created attachment 1771569 [details]
Create PersistentVolumes

Created attachment 1771569 [details]
Create PersistentVolumes

Description of problem:
PersistentVolumes page cannot sync project status automatically which will block user to create PV 

Version-Release number of selected component (if applicable):
4.8.0-0.nightly-2021-04-09-222447

How reproducible:
Every time

Steps to Reproduce:
1. Login to OCP CLI as administrator.
2. Create a Group by using below command and file
   oc create -f testgroup
   
   $cat testgroup
    apiVersion: user.openshift.io/v1
    kind: Group
    metadata:
      name: testgroup
    users:
      - testuser-0
3. Add RoleBindings for the group by following below command:   
   oc adm policy add-cluster-role-to-group system:persistent-volume-provisioner testgroup --rolebinding-name system:persistent-volume-provisioner-for-sre
4. Re-login the OCP as the normal user testuser-0
5. Navigate to page of PersistentVolumes, verify if 'create PersistentVolumes' button is enabled and a notice of suggest user to create a new project can be found on the top of the page (Attached snapshot)
6. Follow the suggestion and click on the link of 'create a new project'
7. Navigate to the page of PersistentVolumes again, verify if the 'Create PersistenVolum' button is enabled, and user is able to create PV without more action.


Actual results:
7. The button of "Create PersistentVolume" is disabled.  

Expected results:
The button of "Create PersistentVolume" can be enabled automatically when user jump to PersistentVolumes page from project page.

Additional info:

Comment 1 Cyril 2021-04-14 00:47:54 UTC
@xiyuzhao I'm unable to reproduce this bug. I followed the steps in BZ but got stuck in 4. Re-login the OCP as the normal user testuser-0. In OCP I need username and password to login. I created a normal user account using console UI with username and password but didn't see PersistentVolumes  in the Storage sub menu.

Comment 2 Xiyun Zhao 2021-04-14 01:23:56 UTC
@cajieh I think the issue is caused by the command of rolebinding, i have update the command for more clear, please try again.

Comment 3 Cyril 2021-04-14 13:06:12 UTC
@xiyuzhao Reproduced.

Comment 6 Xiyun Zhao 2021-06-15 02:08:57 UTC
This bug has been fixed and verified on payload 4.8.0-0.nightly-2021-06-14-145150

Verification step:
1. Login to OCP CLI as administrator.
2. Create a Group by using below command and file
   oc create -f testgroup
   
   $cat testgroup
    apiVersion: user.openshift.io/v1
    kind: Group
    metadata:
      name: testgroup
    users:
      - testuser-0
3. Add RoleBindings for the group by following below command:   
   oc adm policy add-cluster-role-to-group system:persistent-volume-provisioner testgroup --rolebinding-name system:persistent-volume-provisioner-for-sre
4. Re-login the OCP as the normal user testuser-0
5. Navigate to page of PersistentVolumes, verify if 'create PersistentVolumes' button is enabled and a notice of suggest user to create a new project can be found on the top of the page 
6. Follow the suggestion and click on the link of 'create a new project'
7. Navigate to the page of PersistentVolumes again, verify if the 'Create PersistenVolum' button is enabled, and user is able to create PV without more action.

Result:
5,6. The button of "Create PersistentVolume" is enabled by default for PV. User is able to create PV successfully. 

Additional info:     
The created PV can only shown after user create a project by follow the logic.

Comment 9 errata-xmlrpc 2021-07-27 22:59:58 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 (Moderate: OpenShift Container Platform 4.8.2 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-2021:2438