Skip to content

Check for PodPlacementConfigs before tearing down operand resources#740

Open
AnnaZivkovic wants to merge 1 commit intooutrigger-project:mainfrom
AnnaZivkovic:fix-gate-deletion-before-teardown
Open

Check for PodPlacementConfigs before tearing down operand resources#740
AnnaZivkovic wants to merge 1 commit intooutrigger-project:mainfrom
AnnaZivkovic:fix-gate-deletion-before-teardown

Conversation

@AnnaZivkovic
Copy link
Copy Markdown
Member

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

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 14, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2026
_ = r.updateStatus(ctx, clusterPodPlacementConfig)

// Prevent deletion while PodPlacementConfig resources still exist
// Check this BEFORE tearing down webhook/operand resources to prevent orphaning PPCs
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could there be a unit test?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was an integration test. I updated it to look at the webhook as well

@AnnaZivkovic
Copy link
Copy Markdown
Member Author

/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
@AnnaZivkovic AnnaZivkovic force-pushed the fix-gate-deletion-before-teardown branch from c9d89a8 to 6808b93 Compare April 14, 2026 18:45
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 14, 2026

@AnnaZivkovic: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ocp416-e2e-gcp 6808b93 link true /test ocp416-e2e-gcp
ci/prow/ocp417-e2e-gcp 6808b93 link true /test ocp417-e2e-gcp
ci/prow/ocp419-e2e-azure 6808b93 link true /test ocp419-e2e-azure

Full PR test history. Your PR dashboard.

Details

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants