Bug 1460980

Summary: [paid][online-stg]User can create project quota which exceeds his plan resource
Product: OpenShift Online Reporter: yufchang <yufchang>
Component: Accounts and BillingAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED CURRENTRELEASE QA Contact: yufchang <yufchang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, jokerman, mmccomas, wmeng
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-09 18:48:21 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 yufchang 2017-06-13 10:07:51 UTC
Description of problem:
In user's plan , the Max memory is 2Gi Memory for application. But User can create project quota over 2Gi, such as  limits.memory=10Gi.

Version-Release number of selected component (if applicable):
Online-STG 3.5.5.25
online version:3.5.1.32

How reproducible:
100%
quota.json:
{
  "apiVersion": "v1",
  "kind": "ResourceQuota",
  "metadata": {
    "name": "compute-resources"
  },
  "spec": {
     "hard": {
       "limits.cpu": "4",
      "limits.memory": "10Gi"
    },
    "scopes": [
      "NotTerminating"
    ]
  }
}


Steps to Reproduce:
1.login in online-stg , subscribe a base plan;
2.oc new-project pro2;
3.oc create quota.json -n pro2;
4.oc describe quota compute-resources -n pro2


Actual results:
3.resourcequota "compute-resources" created
4.
Name:        compute-resources
Namespace:    pro2
Scopes:        NotTerminating
 * Matches all pods that do not have an active deadline.
Resource    Used    Hard
--------    ----    ----
limits.cpu    0    4
limits.memory    0    10Gi

Expected Result
Failure in create project quota when the memory is over Max memory the user have.

Comment 1 Abhishek Gupta 2017-06-13 15:32:58 UTC
The user is allowed to create a project that that exceeds the user quota. However, the user cannot consume resources that exceed either the project quota or the user (CRQ) quota. The quota screen on the console will show show that the user quota max has been reached.

Comment 2 yufchang 2017-06-14 02:57:43 UTC
ok , thanks