Bug 1891518

Summary: openshift-object-counts quota is not dynamically updating as the resource is deleted.
Product: OpenShift Container Platform Reporter: Lukasz Szaszkiewicz <lszaszki>
Component: kube-controller-managerAssignee: Lukasz Szaszkiewicz <lszaszki>
Status: CLOSED ERRATA QA Contact: zhou ying <yinzhou>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.6CC: aos-bugs, ggore, igreen, jokerman, knarra, lszaszki, maszulik, mfojtik, sthakare, sttts, yinzhou
Target Milestone: ---   
Target Release: 4.6.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1879430
: 1891527 (view as bug list) Environment:
Last Closed: 2020-12-14 13:50:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1879430    
Bug Blocks: 1891527    

Comment 1 zhou ying 2020-11-12 03:32:02 UTC
Done the pre--merge-verify with : 4.6.0-0.ci.test-2020-11-12-023057-ci-ln-mq83wx2:

Steps:
1) create quota:
`oc create quota test1 --hard=openshift.io/imagestreams=10`
2) check the quota:
[zhouying@dhcp-140-138 ~]$ oc describe quota test1
Name:                      test1
Namespace:                 zhouyt
Resource                   Used  Hard
--------                   ----  ----
openshift.io/imagestreams  0     10

3)create the first app:
`oc new-app httpd-example`
4) check the quota:
[zhouying@dhcp-140-138 ~]$ oc get is 
NAME            IMAGE REPOSITORY                                                        TAGS   UPDATED
httpd-example   image-registry.openshift-image-registry.svc:5000/zhouyt/httpd-example          
[zhouying@dhcp-140-138 ~]$ oc describe quota test1
Name:                      test1
Namespace:                 zhouyt
Resource                   Used  Hard
--------                   ----  ----
openshift.io/imagestreams  1     10

5) create the second app:
`oc new-app rails-postgresql-example`
6) check the quota:
[zhouying@dhcp-140-138 ~]$ oc get is 
NAME                       IMAGE REPOSITORY                                                                   TAGS     UPDATED
httpd-example              image-registry.openshift-image-registry.svc:5000/zhouyt/httpd-example              latest   3 minutes ago
rails-postgresql-example   image-registry.openshift-image-registry.svc:5000/zhouyt/rails-postgresql-example   latest   19 seconds ago
[zhouying@dhcp-140-138 ~]$ oc describe quota test1
Name:                      test1
Namespace:                 zhouyt
Resource                   Used  Hard
--------                   ----  ----
openshift.io/imagestreams  2     10

7) delete app:
`oc delete all -l app=httpd-example`
8) check the quota:
[zhouying@dhcp-140-138 ~]$ oc get is 
NAME                       IMAGE REPOSITORY                                                                   TAGS     UPDATED
rails-postgresql-example   image-registry.openshift-image-registry.svc:5000/zhouyt/rails-postgresql-example   latest   About a minute ago
[zhouying@dhcp-140-138 ~]$ oc describe quota test1
Name:                      test1
Namespace:                 zhouyt
Resource                   Used  Hard
--------                   ----  ----
openshift.io/imagestreams  1     10

9)delete all app:
`oc delete all --all`
10) check the quota:
[zhouying@dhcp-140-138 ~]$ oc get is 
No resources found in zhouyt namespace.
[zhouying@dhcp-140-138 ~]$ oc describe quota test1
Name:                      test1
Namespace:                 zhouyt
Resource                   Used  Hard
--------                   ----  ----
openshift.io/imagestreams  0     10


Based on the above we could clarify this issue has fixed.

Comment 2 Lukasz Szaszkiewicz 2020-11-16 09:46:43 UTC
The PR is waiting for the cherry-pick-approved label.

Comment 4 zhou ying 2020-11-27 09:29:06 UTC
Confirmed with latest payload: 4.6.0-0.nightly-2020-11-26-234822 , the issue has fixed:

[root@dhcp-140-138 roottest]# oc get clusterversion 
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.6.0-0.nightly-2020-11-26-234822   True        False         44m     Cluster version is 4.6.0-0.nightly-2020-11-26-234822


steps:
1) `oc create quota test1 --hard=openshift.io/imagestreams=10`
2) [root@dhcp-140-138 roottest]# oc describe quota test1
Name:                      test1
Namespace:                 zhouy
Resource                   Used  Hard
--------                   ----  ----
openshift.io/imagestreams  0     10

3) `oc new-app httpd-example`
4) [root@dhcp-140-138 roottest]# oc get is 
NAME            IMAGE REPOSITORY                                                       TAGS   UPDATED
httpd-example   image-registry.openshift-image-registry.svc:5000/zhouy/httpd-example          
[root@dhcp-140-138 roottest]# oc describe quota test1
Name:                      test1
Namespace:                 zhouy
Resource                   Used  Hard
--------                   ----  ----
openshift.io/imagestreams  1     10
[root@dhcp-140-138 roottest]# oc delete all --all 

[root@dhcp-140-138 roottest]# oc get is 
No resources found in zhouy namespace.
[root@dhcp-140-138 roottest]# oc describe quota test1
Name:                      test1
Namespace:                 zhouy
Resource                   Used  Hard
--------                   ----  ----
openshift.io/imagestreams  0     10

Comment 7 errata-xmlrpc 2020-12-14 13:50:25 UTC
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 (Moderate: OpenShift Container Platform 4.6.8 security and bug fix update), 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/RHSA-2020:5259