Skip to content

Commit 47638f8

Browse files
fix(kamaji): backport datastore unused-deletion deadlock fix (clastix/kamaji#1122)
Deleting a Tenant whose etcd DataStore has 0 referencing TenantControlPlanes left the DataStore stuck Terminating (finalizer kamaji.clastix.io/TenantControlPlane), hanging the etcd helm uninstall and wedging the tenant namespace. Backports clastix/kamaji#1122 (fixes clastix/kamaji#1115) as a source patch on the pinned 26.3.6-edge build. Refs #3018. Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent dad78bd commit 47638f8

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/controllers/datastore_controller.go b/controllers/datastore_controller.go
2+
--- a/controllers/datastore_controller.go
3+
+++ b/controllers/datastore_controller.go
4+
@@ -151,7 +151,7 @@ func (r *DataStore) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
5+
return reconcile.Result{}, nil
6+
}
7+
8+
- if meta.IsStatusConditionFalse(ds.Status.Conditions, kamajiv1alpha1.DataStoreConditionAllowedDeletionType) {
9+
+ if meta.IsStatusConditionFalse(ds.Status.Conditions, kamajiv1alpha1.DataStoreConditionAllowedDeletionType) || len(tcpList.Items) == 0 {
10+
logger.Info("DataStore is not used by any TenantControlPlane object")
11+
12+
meta.SetStatusCondition(&ds.Status.Conditions, metav1.Condition{

0 commit comments

Comments
 (0)