Bug 2023653

Summary: Namespace store,backing store and bucket class creation proceeds even when required fields are empty .
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Mugdha Soni <musoni>
Component: Multi-Cloud Object GatewayAssignee: Kfir Payne <kfpayne>
Status: CLOSED CURRENTRELEASE QA Contact: Mugdha Soni <musoni>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.9CC: afrahman, aos-bugs, badhikar, dzaken, ebenahar, etamir, jrivera, kfpayne, muagarwa, nbecker, nberry, nthomas, ocs-bugs, odf-bz-bot
Target Milestone: ---   
Target Release: ODF 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.10.0-177 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-21 09:12:42 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 button enabled none

Description Mugdha Soni 2021-11-16 09:51:05 UTC
Created attachment 1841993 [details]
Create button enabled

Description of problem:
-------------------------
When user tried to create Namespace store ,bucket class and backing store via UI and the required fields don't have an input , user is able to proceed ahead as "create " button is enabled and an error is encountered after the user clicks on create button (screenshot for same is attached ) 


Version-Release number of selected component:
------------------------------------------------

OCP : 4.9.0-0.nightly-2021-11-12-222121
ODF : 4.9.0-237.ci

How reproducible:
--------------------
Every time


Steps to Reproduce:
---------------------
1. After the OCP cluster creation install ODF operator .
2. Create storage system .
3. Direct to storage--> ODF --> backing store and click in create backing store.
4. Leave one of the required fields empty and click on create.

Actual results:
---------------------
(1) Create button is enabled .

(2) When click on create button , redirects to the next page and an error is encountered which says " Oops, something went wrong ".

(3)When directed to storage --> ODF --> backing store , the BS created in previous step is present in dashboard but the status mentioned is "Rejected".


Expected results:
-----------------------
The create button should be either disabled or user should not be directed to the next page .

Additional info:
---------------------
Same is encountered with namespace store and bucket class.

Comment 4 afrahman 2021-11-19 10:04:50 UTC
*** Bug 2024547 has been marked as a duplicate of this bug. ***

Comment 5 Bipul Adhikari 2021-11-23 06:03:01 UTC
We expect the validation to come from the Operator. There is already a validation framework setup this needs to be leveraged.

Comment 8 Mudit Agarwal 2021-12-01 12:18:07 UTC
Not a 4.9 blocker

Comment 9 Bipul Adhikari 2021-12-02 04:43:29 UTC
Operator needs to check whether the requested Object(CR) has enough information to proceed with CR creation. 
Something like an admission controller(https://kubernetes.io/blog/2019/03/21/a-guide-to-kubernetes-admission-controllers/)
If this is done then UI can just propagate the error sent by the API to the user.

Comment 11 Bipul Adhikari 2021-12-02 08:32:44 UTC
We always propagate the errors sent by the API. We have been doing this for all resources. Moving it to MCG.

Comment 18 Mugdha Soni 2022-02-28 10:33:12 UTC
HI

Validated the fix with following builds:-

OCP : 4.10.0-0.nightly-2022-02-26-230022
ODF : 4.10.0-169

**Observations :

(a) For namespace store , even when all the required fields are not filled with user input, the user can still click on create button and it starts the creation . Later the status is shown as "creating' for long.

(b) The Bucket class is fixed.

(c) For Backing store again the creation is proceeded even if input for all required fields are not present .

Screenshots are present here 'https://docs.google.com/document/d/1ET2NGIeedSg-g06EeMt3_txdkatC3ZDJ74TO5epoIuU/edit?usp=sharing'

Since the fix is only available for Bucket class , re-assigning the bug .

Thanks 
Mugdha

Comment 23 Mugdha Soni 2022-03-22 07:21:34 UTC
Retested the fix with following versions :

OCP:- 4.10.0-0.nightly-2022-03-19-230512

ODF :- 4.10.0-198

When the target bucket was left empty and create button was clicked there was an error message displayed "admission webhook "admissionwebhook.noobaa.io" denied the request: Failed creating the Backingstore, please provide target bucket" and creation was not successful.

Screenshot for same is attached in comment#21 and comment#22 . 
Moving the bug to verified state .


Thanks and Regards
Mugdha Soni