Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-22301

ClusterResourceQuota is stuck in delete state when using foreground deletion cascading strategy

XMLWordPrintable

    • Moderate
    • No
    • False
    • Hide

      None

      Show
      None
    • Hide
      --- edited ---

      * Previously, when deleting a `ClusterResourceQuota` resource using the foreground deletion cascading strategy, the removal failed to complete. With this release, `ClusterResourceQuota` resources are deleted properly when using the foreground cascading strategy. (link:https://issues.redhat.com/browse/OCPBUGS-22301[*OCPBUGS-22301*])

      --- original ---

      Cause: When trying to delete a ClusterResourceQuota resource, using foreground deletion cascading strategy it's stuck in that state and failing to complete the removal.
      Consequence: ClusterResourceQuota deletion not possible with foreground cascading strategy.

      Fix,Result: ClusterResourceQuota deletion is possible with foreground cascading strategy.
      Show
      --- edited --- * Previously, when deleting a `ClusterResourceQuota` resource using the foreground deletion cascading strategy, the removal failed to complete. With this release, `ClusterResourceQuota` resources are deleted properly when using the foreground cascading strategy. (link: https://issues.redhat.com/browse/OCPBUGS-22301 [* OCPBUGS-22301 *]) --- original --- Cause: When trying to delete a ClusterResourceQuota resource, using foreground deletion cascading strategy it's stuck in that state and failing to complete the removal. Consequence: ClusterResourceQuota deletion not possible with foreground cascading strategy. Fix,Result: ClusterResourceQuota deletion is possible with foreground cascading strategy.
    • Bug Fix
    • Done

      Description of problem:

      When trying to delete a ClusterResourceQuota resource, using foreground deletion cascading strategy it's stuck in that state and failing to complete the removal.
      
      Once background deletion cascading strategy is used it's immediately removed.
      
      Now, given that OpenShift GitOps is using foreground deletion cascading strategy by default, this does expose some challenges when managing ClusterResourceQuota resources using OpenShift GitOps.
      

      Version-Release number of selected component (if applicable):

      4.14.0-0.nightly-2023-10-23-223425 but also previous version of OpenShift Container Platform 4 are affected
      

      How reproducible:

      Always
      

      Steps to Reproduce:

      1. Install OpenShift Container Platform 4
      2. Create the ClusterResourceQuota as shown below
      
      $ bat -p /tmp/crq.yaml
      apiVersion: quota.openshift.io/v1
      kind: ClusterResourceQuota
      metadata:
        creationTimestamp: null
        name: blue
      spec:
        quota:
          hard:
            pods: "10"
            secrets: "20"
        selector:
          annotations: null
          labels:
            matchLabels:
              color: nocolor
      
      3. Delete the ClusterResourceQuota using "oc delete --cascade=foreground clusterresourcequota blue"
      

      Actual results:

      $ oc delete --cascade=foreground clusterresourcequota blue
      clusterresourcequota.quota.openshift.io "blue" deleted
      
      Is stuck and won't finish, the resource looks as shown below.
      
      $ oc get clusterresourcequota blue -o yaml
      apiVersion: quota.openshift.io/v1
      kind: ClusterResourceQuota
      metadata:
        annotations:
          kubectl.kubernetes.io/last-applied-configuration: |
            {"apiVersion":"quota.openshift.io/v1","kind":"ClusterResourceQuota","metadata":{"annotations":{},"creationTimestamp":null,"name":"blue"},"spec":{"quota":{"hard":{"pods":"10","secrets":"20"}},"selector":{"annotations":null,"labels":{"matchLabels":{"color":"nocolor"}}}}}
        creationTimestamp: "2023-10-24T07:37:48Z"
        deletionGracePeriodSeconds: 0
        deletionTimestamp: "2023-10-24T07:59:47Z"
        finalizers:
        - foregroundDeletion
        generation: 2
        name: blue
        resourceVersion: "60554"
        uid: c18dd92c-afeb-47f4-a944-8b55be4037d7
      spec:
        quota:
          hard:
            pods: "10"
            secrets: "20"
        selector:
          annotations: null
          labels:
            matchLabels:
              color: nocolor
      

      Expected results:

      The ClusterResourceQuota to be deleted using foreground deletion cascading strategy without being stuck as there does not appear to be any OwnerReference that is still around and blocking removal
      

      Additional info:

      
      

            fkrepins@redhat.com Filip Krepinsky
            rhn-support-sreber Simon Reber
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: