Bug 1427084 - [trello btzCBamB] Used cluster quota by current project is not shown correctly
Summary: [trello btzCBamB] Used cluster quota by current project is not shown correctly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Management Console
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Samuel Padgett
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-27 10:29 UTC by Xingxing Xia
Modified: 2017-05-30 12:50 UTC (History)
5 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:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xingxing Xia 2017-02-27 10:29:09 UTC
Description of problem:
Used cluster quota by current project is not shown correctly

Version-Release number of selected component (if applicable):
openshift v1.5.0-alpha.3+bc6686d-117
kubernetes v1.5.2+43a9be4
etcd 3.1.0

How reproducible:
Always

Steps to Reproduce:
1. Creates 3 projects: prozyp,prozyp1,prozyp2

2. Cluster admin add label to prozyp1,prozyp2, and create cluster resource
quota:
# oc label namespace/prozyp1 test=one
namespace "prozyp1" labeled

# oc label namespace/prozyp2 test=one
namespace "prozyp2" labeled

# oc create clusterresourcequota clusterquota --project-label-selector=test=one --hard=pods=10,memory=1Gi,cpu=800m,secrets=18
clusterresourcequota "clusterquota" created

3. In prozyp1 create pod with cpu/memory resource set.
# oc run testpod1 --image=aosqe/hello-openshift --generator=run-pod/v1 --limits='cpu=300m,memory=300Mi' -n prozyp1

4. Check cluster quota on Resources --> Quota page of prozyp1

Actual results:
4. For CPU/Memory/Pods/Secrets table, it all shows "—" under "Used (This Project)" column.
For CPU/Memory charts, click "Used - This Project", it SHOULD show xx% CPU used by current project, but it shows nothing. Click "Used - Other Projects", it SHOULD show nothing, but it shows xx% CPU used by other projects. (Memory is similar). 

Though CLI shows correctly:
# oc get clusterquota clusterquota -o yaml --config /openshift.local.config/master/admin.kubeconfig
...
status:
  namespaces:
  - namespace: prozyp1
    status:
      hard:
        cpu: 500m
        memory: 1Gi
        pods: "4"
        secrets: "18"
      used:
        cpu: 300m
        memory: 300Mi
        pods: "1"
        secrets: "9"
  - namespace: prozyp2
    status:
      hard:
        cpu: 500m
        memory: 1Gi
        pods: "4"
        secrets: "18"
      used:
        cpu: "0"
        memory: "0"
        pods: "0"
        secrets: "9"
  total:
    hard:
      cpu: 500m
      memory: 1Gi
      pods: "4"
      secrets: "18"
    used:
      cpu: 300m
      memory: 300Mi
      pods: "1"
      secrets: "18"


Expected results:
4. Table and Chart should show correctly as CLI


Additional info:

Comment 1 Samuel Padgett 2017-02-27 16:59:05 UTC
This is only a problem in 3.6.

https://github.com/openshift/origin-web-console/pull/1307

Comment 2 openshift-github-bot 2017-02-27 20:36:30 UTC
Commit pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/71d4685a28a332d0210291783a34138b52590cfb
Bug 1427084 - Fix problem showing project usage for cluster quota

Since we switched from a `clusterQuotas` map to a `clusterQuotas` array
for sorting, we incorrectly keyed the `namespaceUsageByClusterQuota` map
by array index instead of namespace. This prevented the project usage
for a cluster quota from displaying.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1427084

Comment 3 Xingxing Xia 2017-03-01 10:55:39 UTC
Verified in: openshift v1.5.0-alpha.3+f45c2bd-134
Fix. Now cluster quota used by current/other/all project(s) are displayed correctly in table, chart.


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