The deletion of the remaining packages because of waiting on the ImageRepository CRD.
search cancel

The deletion of the remaining packages because of waiting on the ImageRepository CRD.

book

Article ID: 376013

calendar_today

Updated On:

Products

VMware Tanzu Application Platform

Issue/Introduction

The accelerator and source-controller could not be deleted and have remained in the 'Deleting' status for a few days.

# tanzu package installed list -A
  NAMESPACE    NAME               PACKAGE-NAME                             PACKAGE-VERSION  STATUS
  tap-install  accelerator        accelerator.apps.tanzu.vmware.com        1.10.0           Deleting
  tap-install  source-controller  controller.source.apps.tanzu.vmware.com  0.9.1            Deleting
  tap-install  tap                tap.tanzu.vmware.com                     1.10.1           Deleting

 

The deletion of the remaining packages is waiting on the ImageRepository CRD.

# the tanzu package installed status source-controller -n tap-install 

NAME:         source-controller
NAMESPACE:    tap-install
STATUS:       Deleting
METRICS:      289 consecutive failures

8:28:21AM: Deleting 
	    | Target cluster 'https://***.*.*.*:***' (nodes:p-*-*-*-*-**.*********.compute.internal, 2+)
	    | Changes
	    | Namespace      Name                                              Kind                            Age  Op      Op st.  Wait to  Rs       Ri
	    | (cluster)      imagerepositories.source.apps.tanzu.vmware.com    CustomResourceDefinition        27d  delete  -       delete   ongoing  Waiting on finalizers:
	    |                                                                                                                                         customresourcecleanup.apiextensions.k8s.io
	    | ^              source-app-viewer                                 ClusterRole                     27d  delete  -       delete   ok       -
	    | ^              source-manager-role                               ClusterRole                     27d  delete  -       delete   ok       -
	    | ^              source-manager-rolebinding                        ClusterRoleBinding              27d  delete  -       delete   ok       -
	    | ^              source-metrics-reader                             ClusterRole                     27d  delete  -       delete   ok       -
......

 

# tanzu package installed status accelerator -n tap-install

NAME:         accelerator
NAMESPACE:    tap-install
STATUS:       Deleting
METRICS:      288 consecutive failures

8:20:11AM: Deleting 
	    | Target cluster 'https://***.*.*.*:***' (nodes:p-*-*-*-*-**.*********.compute.internal, 2+)
	    | Changes
	    | Namespace           Name                                           Kind             Age  Op      Op st.  Wait to  Rs       Ri
	    | (cluster)           accelerator-system                             Namespace        27d  delete  -       delete   ongoing  Deleting
	    | accelerator-system  angular-frontend-acc-x78mv                     ImageRepository  27d  -       -       delete   ongoing  Waiting on finalizers:
	    |                                                                                                                            source.apps.tanzu.vmware.com/finalizer
	    | ^                   app-sso-client-frag-tp9sg                      ImageRepository  27d  -       -       delete   ongoing  Waiting on finalizers:
	    |                                                                                                                            source.apps.tanzu.vmware.com/finalizer
	    | ^                   appsso-starter-java-acc-gb5vr                  ImageRepository  27d  -       -       delete   ongoing  Waiting on finalizers:
	    |                                                                                                                            source.apps.tanzu.vmware.com/finalizer
......

 

 

Also, to delete the package directly using kubectl, but they timed out.

kubectl delete packageinstall accelerator -n tap-install --force --grace-period=0
kubectl delete packageinstall source-controller -n tap-install --force --grace-period=0
kubectl delete packageinstall tap -n tap-install --force --grace-period=0

Error message samply:

kubectl delete packageinstall source-controller -n tap-install --force --grace-period
=011:01:14AM: DeleteFailed: kapp: Error: Timed out waiting after 15m0s for resources:
  - endpoints/source-controller-manager-metrics-service (v1) namespace: source-system
  - customresourcedefinition/imagerepositories.source.apps.tanzu.vmware.com (apiextensions.k8s.io/v1) cluster
  - endpoints/source-webhook-service (v1) namespace: source-system
......

 

Cause

The deletion of the remaining packages is waiting on the ImageRepository CRD.

Resolution

To delete the finalizer from the resource, you can go through the deletion.

You can erther kubectl edit the crd and remove the finalizer block which in edit mode.

OR

kubectl patch crd imagerepositories.source.apps.tanzu.vmware.com -p '{"metadata":{"finalizers":[]}}' --type=merge