Bug 2158277

Summary: [odf 4.10] - overprovisionControl- Added "ocs-" prefix to cluster resource quota name
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Oded <oviner>
Component: ocs-operatorAssignee: Malay Kumar parida <mparida>
Status: CLOSED ERRATA QA Contact: Parag Kamble <pakamble>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.10CC: etamir, mparida, ocs-bugs, odf-bz-bot, ssharon
Target Milestone: ---   
Target Release: ODF 4.10.12   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-04-26 17:13:29 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:

Description Oded 2023-01-04 22:13:44 UTC
Description of problem (please be detailed as possible and provide log
snippests):
When we create an overprovisionControl based on ocs-storagecluster-ceph-rbd and ocs-storagecluster-ceph-fs storage class, clusterresourcequota name is  ocs-ocs-storagecluster-ceph-rbd-quota-sc-test.
The expected name is <SC-NAME>-<quotaName>


Version of all relevant components (if applicable):
OCP Version:4.10.0-0.nightly-2022-12-25-031753
ODF version: 4.10.10-1
Provider: Vmware

Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?


Is there any workaround available to the best of your knowledge?


Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)?


Can this issue reproducible?


Can this issue reproduce from the UI?


If this is a regression, please provide more details to justify this:


Steps to Reproduce:

1.Create project with “openshift-quota” label
$ oc new-project ocs-quota-sc-test
$ oc label Namespace ocs-quota-sc-test openshift-quota=quota-sc-test

2.Add 'overprovisionControl' section to storagecluster yaml file:
$ oc -n openshift-storage patch storagecluster ocs-storagecluster -n openshift-storage -p '{"spec": {"overprovisionControl": [{"capacity": "8Gi","storageClassName":"ocs-storagecluster-ceph-rbd", "quotaName": "quota-sc-test", "selector": {"labels": {"matchLabels": {"openshift-quota":"quota-sc-test"}}}}]}}' --type merge

$ oc get storagecluster -n openshift-storage -o yaml | grep overprovisionControl -A 7
    overprovisionControl:
    - capacity: 8Gi
      quotaName: quota-sc-test
      selector:
        labels:
          matchLabels:
            openshift-quota: quota-sc-test
      storageClassName: ocs-storagecluster-ceph-rbd

3.Check clusterresourcequota name
$ oc get clusterresourcequota
NAME                                            AGE
ocs-ocs-storagecluster-ceph-rbd-quota-sc-test   3m1s

$ oc describe  clusterresourcequota ocs-ocs-storagecluster-ceph-rbd-quota-sc-test 
Name:		ocs-ocs-storagecluster-ceph-rbd-quota-sc-test
Created:	3 minutes ago
Labels:		<none>
Annotations:	<none>
Namespace Selector: ["ocs-quota-sc-test"]
Label Selector: openshift-quota=quota-sc-test
AnnotationSelector: map[]
Resource									Used	Hard
--------									----	----
ocs-storagecluster-ceph-rbd.storageclass.storage.k8s.io/requests.storage	0	8Gi



Same Process on ODF4.12:
$  oc get storagecluster -n openshift-storage -o yaml | grep overprovisionControl -A 7
    overprovisionControl:
    - capacity: 8Gi
      quotaName: quota-sc-test
      selector:
        labels:
          matchLabels:
            openshift-quota: quota-sc-test
      storageClassName: ocs-storagecluster-ceph-rbd

$ oc get clusterresourcequota
NAME                                        AGE
ocs-storagecluster-ceph-rbd-quota-sc-test   77s



Actual results:

$ oc get clusterresourcequota
NAME                                            AGE
ocs-ocs-storagecluster-ceph-rbd-quota-sc-test   3m1s

Expected results:
$ oc get clusterresourcequota
NAME                                        AGE
ocs-storagecluster-ceph-rbd-quota-sc-test   77s

Additional info:

Comment 3 Oded 2023-01-05 12:51:23 UTC
Are we planning to fix this in ODF4.10?

I opened a new pr to fix the automation test on ODF4.10
https://github.com/red-hat-storage/ocs-ci/pull/6887/files

Comment 7 Malay Kumar parida 2023-03-09 07:22:36 UTC
Hi Oded, This has been fixed in 4.11 
PR-https://github.com/red-hat-storage/ocs-operator/pull/1614
BZ-https://bugzilla.redhat.com/show_bug.cgi?id=2016503

We can use this current BZ to backport the fix to 4.10

Comment 18 errata-xmlrpc 2023-04-26 17:13:29 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 (Red Hat OpenShift Data Foundation 4.10.12 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/RHBA-2023:2032