Bug 1400912 - Should show certain namespaces when describe clusterresourcequota
Summary: Should show certain namespaces when describe clusterresourcequota
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-02 09:46 UTC by Qixuan Wang
Modified: 2017-05-30 12:50 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-30 12:50:40 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Qixuan Wang 2016-12-02 09:46:12 UTC
Description of problem:
When describe clusterresourcequota, it should show namespaces which share the clusterresourcequota.


Version-Release number of selected component (if applicable):
openshift v1.5.0-alpha.0+b7eca0d-178
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0


How reproducible:
Always

Steps to Reproduce:
1. Create a clusterresourcequota with project-annotation-selector
# oc create clusterresourcequota crq-1 --project-annotation-selector=openshift.io/requester=user --hard=secrets=50

2. Create namespaces with annotation
# oc new-project p-1 --as=user
# oc new-project p-2 --as=user
# oc new-project p-3 --as=dev

3. Describe the clusterresourcequota
# oc describe clusterresourcequota crq-1
# oc get clusterresourcequota crq-1 -o yaml


Actual results:
3. [root@dhcp-140-45 v3test]# oc describe clusterresourcequota crq-1
Name:		crq-1
Namespace:	<none>
Created:	32 seconds ago
Labels:		<none>
Annotations:	<none>
Label Selector: <null>
AnnotationSelector: map[openshift.io/requester:user]
Resource	Used	Hard
--------	----	----
secrets		18	50

[root@dhcp-140-45 v3test]# oc get clusterresourcequota crq-1 -o yaml
apiVersion: v1
kind: ClusterResourceQuota
metadata:
  creationTimestamp: 2016-12-02T09:16:26Z
  name: crq-1
  resourceVersion: "7692"
  selfLink: /oapi/v1/clusterresourcequotas/crq-1
  uid: 00a73ec8-b870-11e6-8b9a-0eb6a5c02baa
spec:
  quota:
    hard:
      secrets: "50"
  selector:
    annotations:
      openshift.io/requester: user
    labels: null
status:
  namespaces:
  - namespace: p-1
    status:
      hard:
        secrets: "50"
      used:
        secrets: "9"
  - namespace: p-2
    status:
      hard:
        secrets: "50"
      used:
        secrets: "9"
  total:
    hard:
      secrets: "50"
    used:
      secrets: "18"



Expected results:
Should show namespaces like this
# oc describe clusterresourcequota crq-1
Name:		crq-1
Namespace:	p-1, p-2
Created:	32 seconds ago
Labels:		<none>
Annotations:	<none>
Label Selector: <null>
AnnotationSelector: map[openshift.io/requester:user]
Resource	Used	Hard
--------	----	----
secrets		18	50


Additional info:
Namespace binding quota:
[root@dhcp-140-45 v3test]# oc project
Using project "p-3" on server "https://ec2-54-89-15-228.compute-1.amazonaws.com:8443".

[root@dhcp-140-45 v3test]# oc create quota quota-1 --hard=secrets=30
resourcequota "quota-1" created

[root@dhcp-140-45 v3test]# oc describe quota quota-1
Name:		quota-1
Namespace:	p-3
Resource	Used	Hard
--------	----	----
secrets		9	30

Comment 1 Derek Carr 2016-12-12 21:55:16 UTC
I agree it would be cover to know the covered set of namespaces, but I think it should be a different section than the current Name/Namespace.  Reassigning to CLI team.

Comment 2 Juan Vallejo 2016-12-19 21:42:47 UTC
Related PR: https://github.com/openshift/origin/pull/12292

Comment 3 Qixuan Wang 2016-12-22 07:10:37 UTC
Tested on Origin devenv_rhel7_5588(openshift v1.5.0-alpha.0+583adaf-501, kubernetes v1.4.0+776c994, etcd 3.1.0-rc.0), the bug has been fixed, thanks.

Here is the result:

# oc describe clusterresourcequota crq-1
Name:		crq-1
Namespace:	<none>
Created:	36 seconds ago
Labels:		<none>
Annotations:	<none>
Namespace Selector: ["p-1" "p-2"]
Label Selector: <null>
AnnotationSelector: map[openshift.io/requester:user]
Resource	Used	Hard
--------	----	----
secrets		17	50


Note You need to log in before you can comment on or make changes to this bug.