Enable OwnerReferencesPermissionEnforcement in e2e and improve test failure diagnostic#389
Merged
Merged
Conversation
✅ Deploy Preview for agent-sandbox canceled.
|
Contributor
Author
|
Have expected error /hold for #377 |
aditya-shantanu
approved these changes
Mar 11, 2026
This admission plugin enforces that users must have finalizers permission on the owner resource to set blockOwnerDeletion in ownerReferences. Enabling it in e2e ensures RBAC issues like the one fixed in kubernetes-sigs#377 are caught by tests.
Contributor
Author
|
/hold cancel |
Contributor
Author
|
/retest |
|
/assign @janetkuo |
|
/lgtm |
- Add dumpControllerLogs to afterEach: on test failure, fetch controller logs and write full logs to the artifacts directory (available in Prow) and print last 42 lines to test output. - Fix Watch/MustWatch to accept context parameter so the timeout set by WaitForObject actually propagates to the watch loop. - Cap WaitForObject and PollUntilObjectMatches at DefaultTimeout (60s) even when the parent context has a longer deadline, so tests fail gracefully and cleanup functions run. - Fix WatchSet to use context.Background for the watchLoop so it outlives any individual caller's context and stays alive for the duration of the test.
Add sandboxclaims/finalizers and sandboxwarmpools/finalizers RBAC markers so the SandboxClaim and SandboxWarmPool controllers can set blockOwnerDeletion in ownerReferences when OwnerReferencesPermissionEnforcement is enabled.
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aditya-shantanu, janetkuo, yongruilin 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 |
chw120
pushed a commit
to chw120/agent-sandbox
that referenced
this pull request
Mar 13, 2026
…ailure diagnostic (kubernetes-sigs#389) * Enable OwnerReferencesPermissionEnforcement in e2e kind cluster This admission plugin enforces that users must have finalizers permission on the owner resource to set blockOwnerDeletion in ownerReferences. Enabling it in e2e ensures RBAC issues like the one fixed in kubernetes-sigs#377 are caught by tests. * Dump controller logs on e2e test failure and fix watch timeout - Add dumpControllerLogs to afterEach: on test failure, fetch controller logs and write full logs to the artifacts directory (available in Prow) and print last 42 lines to test output. - Fix Watch/MustWatch to accept context parameter so the timeout set by WaitForObject actually propagates to the watch loop. - Cap WaitForObject and PollUntilObjectMatches at DefaultTimeout (60s) even when the parent context has a longer deadline, so tests fail gracefully and cleanup functions run. - Fix WatchSet to use context.Background for the watchLoop so it outlives any individual caller's context and stays alive for the duration of the test. * Add finalizers RBAC for extensions controllers Add sandboxclaims/finalizers and sandboxwarmpools/finalizers RBAC markers so the SandboxClaim and SandboxWarmPool controllers can set blockOwnerDeletion in ownerReferences when OwnerReferencesPermissionEnforcement is enabled.
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 PR improves e2e test coverage for RBAC correctness and makes test failures easier to diagnose.
Enable OwnerReferencesPermissionEnforcement admission plugin in e2e kind cluster
Add missing finalizers RBAC for extensions controllers
sandboxclaims/finalizersandsandboxwarmpools/finalizersRBAC markers so the SandboxClaim and SandboxWarmPool controllers work with OwnerReferencesPermissionEnforcement enabledextensions-rbac.generated.yamlDump controller logs on e2e test failure
Fix e2e watch timeout propagation
WaitForObjectandPollUntilObjectMatchesat DefaultTimeout (60s) even when the parent context has a longer deadline