generated from openmcp-project/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
area/open-mcpAll ManagedControlPlane related issuesAll ManagedControlPlane related issuesenhancementNew feature or requestNew feature or request
Description
What would you like to be added:
The ClusterAccess library can be improved in the following ways:
- Currently, only a single AccessRequest or ClusterRequest is deleted, then the library returns and requests a requeue to wait for the deletion. This should instead delete all AccessRequests in the first step and then all ClusterRequests together, not only a single one.
- Calling the library's
Reconcilemethod during deletion is problematic at the moment: In theory, it should be called beginning of the reconciliation to ensure that the access to the clusters is available in order to undeploy stuff. However, at the end of the reconciliation,ReconcileDeleteshould be called, which then removes some resources (AccessRequests first) and requests a requeue. If thenReconcileis called again, it will restore the already deleted AccessRequest, causing a loop of infinite reconciliations.- It is possible to figure out whether the AccessRequest has already been deleted, but this is not intuitive.
Solution Proposal:
@reshnm proposed the following approach to solve the deletion problem: During the regular Reconcile, AccessRequests are created with a finalizer. This means that if Reconcile is called during deletion, it can recognize that via the resource's DeletionTimestamp and not update the AccessRequest. During ReconcileDelete, the finalizer is only removed when it is the only one remaining on the AccessRequest. This ensures that the corresponding resources have already been deleted by the responsible ClusterProvider.
We apply the same logic when deleting ClusterRequests.
Metadata
Metadata
Assignees
Labels
area/open-mcpAll ManagedControlPlane related issuesAll ManagedControlPlane related issuesenhancementNew feature or requestNew feature or request