From 83c99ab484109cf2715d4fcccbaecc7597b7e2cf Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Tue, 14 Apr 2026 11:32:54 +0200 Subject: [PATCH] fix(ds): allow deletion for unused datastores (#1122) Signed-off-by: Dario Tranchitella --- controllers/datastore_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/datastore_controller.go b/controllers/datastore_controller.go index 33f200a..14cbd1c 100644 --- a/controllers/datastore_controller.go +++ b/controllers/datastore_controller.go @@ -163,7 +163,7 @@ func (r *DataStore) Reconcile(ctx context.Context, request reconcile.Request) (r return reconcile.Result{}, nil } - if meta.IsStatusConditionFalse(ds.Status.Conditions, kamajiv1alpha1.DataStoreConditionAllowedDeletionType) { + if meta.IsStatusConditionFalse(ds.Status.Conditions, kamajiv1alpha1.DataStoreConditionAllowedDeletionType) || len(tcpList.Items) == 0 { logger.Info("DataStore is not used by any TenantControlPlane object") meta.SetStatusCondition(&ds.Status.Conditions, metav1.Condition{