diff --git a/packages/system/kamaji/images/kamaji/patches/fix-datastore-unused-deletion.diff b/packages/system/kamaji/images/kamaji/patches/fix-datastore-unused-deletion.diff new file mode 100644 index 000000000..53073699b --- /dev/null +++ b/packages/system/kamaji/images/kamaji/patches/fix-datastore-unused-deletion.diff @@ -0,0 +1,12 @@ +diff --git a/controllers/datastore_controller.go b/controllers/datastore_controller.go +--- a/controllers/datastore_controller.go ++++ b/controllers/datastore_controller.go +@@ -151,7 +151,7 @@ func (r *DataStore) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) { + 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{