Repository navigation
fix: Make a binding on a Project a dependent of that Project - #845
Open
vvoytovych wants to merge 3 commits into
Open
vvoytovych wants to merge 3 commits into
vvoytovych wants to merge 3 commits into
Conversation
An update of a binding that already carries an owner reference to the uid it names now makes no live read. After the backfill every update of an owned binding takes this path, and with failurePolicy=fail a failed or slow read would refuse it.
vvoytovych
marked this pull request as draft
October 15, 2026 14:03
The test created the datum-cloud namespace and a Role in it, which policybinding-org-restrictions also creates and deletes in its cleanup. Run in parallel, the Role's create met the terminating namespace and timed out. The bindings are created as the platform admin, which needs no assignable role, so the test now creates neither.
vvoytovych
marked this pull request as ready for review
October 15, 2026 15:18
savme
approved these changes
Oct 15, 2026
scotwells
requested changes
Oct 15, 2026
scotwells
left a comment
Contributor
There was a problem hiding this comment.
@vvoytovych we'll need to do this in a controller and "adopt" a policy binding by a project. This is because there's a webhook on project creation that adds a policy binding for the authenticated user creating the project to become the owner of the project. If the policy binding gets created with the owner reference before the project is created, the garbage collector will remove the policy binding.
Contributor
Author
|
Looking deeper into it. |
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.
Summary
Editor and viewer PolicyBindings on a Project stay behind when the Project is deleted, and each one then keeps
PolicyBindingsNotReadyfiring. Only the project owner's binding carries an owner reference to its Project, fromcreateOwnerPolicyBinding.resourceKindselectorsPolicyBindingValidatoralready names as future.controllernorblockOwnerDeletion, as on the owner binding.Test plan
test/iam/policybinding-project-owner-gc, against Milo's own garbage collector. A binding gains the reference and goes with its Project. A binding that names another uid gets none and stays. An update that strips the reference gets it back. It fails onmain, where the binding gets no owner reference.test/iamandtest/resource-managementon the test-infra cluster, besidemainunder the same parallel load. Both runs had two cleanups time out while a Project was being deleted, and nothing else failed.go test ./...Fixes #735
Related to #740