DG project does not get deleted

Solution Verified - Updated

Environment

  • Red hat OpenShift Container Platform (OCP)
    • 8.x
  • Red Hat Data Grid (RHDG)
    • 8.x

Issue

  • After deleting a project it still can be found
  • oc delete deletes a project but it still there

Resolution

Steps:

  1. check all the resources that are still inside the project and check which ones are not yet deleted
  2. Most of the times it is a CRs, usually the cache crs.
  3. ‘oc delete cr_type your-crd’ and check in the metadata section the part of finalizers and remove the elements of the array: oc edit cr_type your-Cr
  4. save and exit
  5. Some seconds later, the project should be removed

If it is not removed:

  • Likely that there are still have other CRs in that project that were not removed
  • the project itself has a finalizer that should be removed. In that case ‘oc edit project your-project’ and delete the metadata.finalizers section

Iterating over hang caches:

For a huge list of caches just do:

for CR in $(oc get cache -o name) ; do  oc patch $CR  -p '{"metadata":{"finalizers":null}}' --type=merge; done

Root Cause

Finalizers do not finalize the custom resources/project and hang for project deletion.

Product(s)
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.