Check for PodPlacementConfigs before tearing down operand resources#740
Check for PodPlacementConfigs before tearing down operand resources#740AnnaZivkovic wants to merge 1 commit intooutrigger-project:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AnnaZivkovic The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| _ = r.updateStatus(ctx, clusterPodPlacementConfig) | ||
|
|
||
| // Prevent deletion while PodPlacementConfig resources still exist | ||
| // Check this BEFORE tearing down webhook/operand resources to prevent orphaning PPCs |
There was a problem hiding this comment.
There was an integration test. I updated it to look at the webhook as well
|
/retest |
Move the PPC existence check BEFORE deleting webhook/operand resources in handleDelete to prevent orphaning namespaced PodPlacementConfigs. Previously, if admission was unavailable or deletion bypassed the webhook, the deletion flow could tear down the webhook and operand while PPCs still existed, leaving them orphaned without the resources they depend on. Now the deletion is properly gated: 1. Check if CPPCNoPPCObjectFinalizer exists 2. List all PodPlacementConfigs 3. Abort with RemainingPodPlacementConfig error if any exist 4. Only proceed to delete resources after confirming zero PPCs This enforces ordered deletion as required by the coding guidelines: pods must be ungated before operand removal
c9d89a8 to
6808b93
Compare
|
@AnnaZivkovic: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Move the PPC existence check before deleting webhook/operand resources in handleDelete to prevent orphaning namespaced PodPlacementConfigs.
Previously, if admission was unavailable or deletion bypassed the webhook, the deletion flow could tear down the webhook and operand while PPCs still existed, leaving them orphaned without the resources they depend on.
Now the deletion is properly gated:
This enforces ordered deletion as required by the coding guidelines: pods must be ungated before operand removal