Troubleshooting Uninstall
Troubleshooting uninstall
Removing a terminating namespace
Occasionally some of the custom resources managed by an operator may remain in “Terminating” status waiting on a finalizer to complete. The resources remain in the “Terminating” state even after you have performed all the uninstall steps, or you are not able to uninstall from the web console because the uninstall option is greyed out.
Check that the namespace is stuck in Terminating state upon deletion.
oc get namespace ${acd_namespace}Output:
NAME STATUS AGEmy-acd-namespace Terminating 46mCheck for the
NamespaceFinalizersRemaining
andNamespaceContentRemaining
messages in theSTATUS
section of the command output and perform the next step for each of the listed resources.oc get namespace ${acd_namespace} -o yamlOutput:
status:conditions:- lastTransitionTime: "2021-06-23T18:20:03Z"message: All resources successfully discoveredreason: ResourcesDiscoveredstatus: "False"type: NamespaceDeletionDiscoveryFailure- lastTransitionTime: "2021-06-23T18:20:03Z"message: All legacy kube types successfully parsedDelete all the remaining resources listed in the previous step.
For each of the resources to be deleted, do the following:
Get the object kind of the resource which needs to be removed. See the message in the above output.
Example:
message: Some resources are remaining: acds.wh-acd.ibm.com has 1 resource instances
Here
acds.wh-acd.ibm.com
is the object kind.Get the Object name corresponding to the object kind.
oc get <object-kind> -n ${acd_namespace}Example:
oc get acds.wh-acd.ibm.com -n ${acd_namespace}Example output:
NAME AGEacd-instances 26hPatch the resources.
oc patch -n ${acd_namespace} <object-kind>/<object-name> --type=merge -p '{"metadata": {"finalizers":null}}'Example:
oc patch -n ${acd_namespace} \acds.wh-acd.ibm.com/acd-instance \--type=merge -p '{"metadata": {"finalizers":null}}'Output:
acd.wh-acd.ibm.com/acd-instance patched
Verify that the namespace is deleted.
oc get namespace ${acd_namespace}Output:
Error from server (NotFound): namespaces "my-acd-namespace" not found
Use these troubleshooting steps with caution. Read more about the hidden dangers of terminating namespaces and troubleshooting similar issues when unable to delete a resource.