Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1401073 - Deleted namespaces are not removed from clusterresourcequota status
Deleted namespaces are not removed from clusterresourcequota status
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Master (Show other bugs)
3.3.1
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Jordan Liggitt
Qixuan Wang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-12-02 12:41 EST by Jordan Liggitt
Modified: 2017-03-08 13 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-18 07:56:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 12:23:26 EST

  None (edit)
Description Jordan Liggitt 2016-12-02 12:41:58 EST
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
Comment 1 Jordan Liggitt 2016-12-05 10:08:21 EST
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
Comment 2 Jordan Liggitt 2016-12-05 10:09:45 EST
fixed in ose 3.3 in https://github.com/openshift/ose/pull/492
Comment 4 Troy Dawson 2016-12-06 16:04:16 EST
This has been merged into ocp and is in OCP v3.4.0.33 or newer.
Comment 6 Qixuan Wang 2016-12-07 01:07:31 EST
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"
Comment 8 errata-xmlrpc 2017-01-18 07:56:49 EST
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

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