Description of problem: Spawned from https://bugzilla.redhat.com/show_bug.cgi?id=1400200#c5 Once a clusterresourcequota (CRQ) selects a namespace, removing the namespace (or changing the labels/annotations on the namespace so that it no longer matches the CRQ's selector) does not remove the namespace from the CRQ's status. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: oc delete clusterresourcequota --all oc delete ns --all oc create clusterresourcequota crq-1 --project-annotation-selector=openshift.io/requester=user --hard=secrets=50,pods=20 oc new-project p-1 --as=user oc new-project p-2 --as=user oc get clusterresourcequota -o yaml oc delete ns/p-1 oc get clusterresourcequota -o yaml # p-1 still appears in CRQ status, but with 0 usage oc new-project p-1 --as=user2 # p-1 still appears in CRQ status, but with 0 usage restart the api server # p-1 still appears in CRQ status, but with 0 usage
fixed in origin 1.4 in https://github.com/openshift/origin/pull/12125 fixed in origin master in https://github.com/openshift/origin/pull/12123
fixed in ose 3.3 in https://github.com/openshift/ose/pull/492
This has been merged into ocp and is in OCP v3.4.0.33 or newer.
Tested on OCP 3.4.0.33(openshift v3.4.0.33+71c05b2, kubernetes v1.4.0+776c994, etcd 3.1.0-rc.0),the problem has been solved, thanks. Here are steps: # oc create clusterresourcequota crq-1 --project-annotation-selector=openshift.io/requester=user --hard=secrets=50 clusterresourcequota "crq-1" created # oc new-project p-1 --as=user # oc new-project p-2 --as=user # oc get clusterresourcequota crq-1 -o yaml apiVersion: v1 kind: ClusterResourceQuota metadata: creationTimestamp: 2016-12-07T05:48:08Z name: crq-1 resourceVersion: "5256" selfLink: /oapi/v1/clusterresourcequotas/crq-1 uid: bb65ba06-bc40-11e6-898f-0eda563642d4 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" # oc delete project p-1 project "p-1" deleted # oc get clusterresourcequota crq-1 -o yaml apiVersion: v1 kind: ClusterResourceQuota metadata: creationTimestamp: 2016-12-07T05:48:08Z name: crq-1 resourceVersion: "5335" selfLink: /oapi/v1/clusterresourcequotas/crq-1 uid: bb65ba06-bc40-11e6-898f-0eda563642d4 spec: quota: hard: secrets: "50" selector: annotations: openshift.io/requester: user labels: null status: namespaces: - namespace: p-2 status: hard: secrets: "50" used: secrets: "9" total: hard: secrets: "50" used: secrets: "9"
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, 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-2017:0066