Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-10262

Secret clean up is stuck on barbican-db-secret

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • barbican-operator
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • ?
    • ?
    • ?
    • None
    • Moderate

      After deleting operators and CRs as

      for crd in $(oc get crds | awk '/openstack|rabbitmq/ { print $1 }'); do
        for res in $(oc get -o name ${crd} | awk '{ print $1}'); do
          oc delete ${res}
        done;
        echo "Deleting ${crd} crd";
        oc delete crd ${crd};
      done
      

      I tried to delete secrets so I ran

          for secret in $(oc -o name get secrets -n openstack); do 
            echo "Deleting secret ${secret}"; 
            oc delete ${secret} -n openstack; 
          done
      

      However, the deletion is stuck on `barbican-db-secret`
      Looking at barbican-db-secret it looks like

      apiVersion: v1
      data: 
        DatabasePassword: XXXX=
      immutable: true
      kind: Secret
      metadata: 
        creationTimestamp: "2024-09-17T20:18:14Z"
        deletionGracePeriodSeconds: 0
        deletionTimestamp: "2024-09-18T14:07:19Z"
        finalizers: 
        - openstack.org/barbican
        name: barbican-db-secret
        namespace: openstack
        ownerReferences: 
        - apiVersion: barbican.openstack.org/v1beta1
          blockOwnerDeletion: true
          controller: true
          kind: Barbican
          name: barbican
          uid: 4730cb4e-13a2-41dd-86f1-b266d625e79d
        resourceVersion: "20890767"
        uid: 0e517b6b-3283-47ab-b192-57ae06825c19
      type: Opaque
      

      so I can see `openstack.org/barbican` even taking in account that Barbican CR is deleted. Looking at barbican-operator I was not able to find any logic to set ownership on it such that the Secret isn't auto-deleted when the Barbican CR is deleted

              Unassigned Unassigned
              rhn-engineering-sgolovat Sergii Golovatiuk
              rhos-dfg-security
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: