[main] Fix metadata-webhook cleanup race condition#3974
Open
openshift-cherrypick-robot wants to merge 3 commits intoopenshift-knative:mainfrom
Open
[main] Fix metadata-webhook cleanup race condition#3974openshift-cherrypick-robot wants to merge 3 commits intoopenshift-knative:mainfrom
openshift-cherrypick-robot wants to merge 3 commits intoopenshift-knative:mainfrom
Conversation
Add namespaceSelector to the MutatingWebhookConfiguration to limit the webhook's scope to namespaces with the samples.knative.dev/release label. This prevents the webhook from blocking resource deletions in other namespaces when the serving-tests namespace is torn down. The issue occurred during upgrade test cleanup where the Route resource for deployment-upgrade-failure could not be deleted because the webhook service was unavailable after namespace cleanup started. Assisted-by: 🤖 Claude Opus/Sonnet 4.5
Delete webhook resources before namespace deletion to prevent blocking Route finalizer removal when webhook service is unavailable. The issue occurs when: 1. Tests complete and cleanup starts 2. 'kubectl delete ns serving-tests' begins namespace deletion 3. Routes have finalizers that need removal 4. Finalizer removal triggers the MutatingWebhookConfiguration 5. Webhook service (in serving-tests) is already being deleted 6. Webhook call times out, blocking namespace deletion Solution: Delete the webhook resources (including the cluster-scoped MutatingWebhookConfiguration) before deleting the serving-tests namespace. This mirrors the installation order and prevents the race condition.
The webhook config directory includes 100-namespace.yaml which deletes the serving-tests namespace. Adding --ignore-not-found prevents the error when the namespace is already deleted.
Member
|
/lgtm |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cardil, openshift-cherrypick-robot 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 |
Member
|
/test 420-kitchensink-e2e Infra issues |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #3973
/assign cardil