[WIP] feat(controller: Allow subjects to act as Owner to bypass the webhook #1332
+46
−4
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.
As a group of us have been discussing here: #1311
This feature adds a new flag in
additionalRoleBindings
which allows the subject toactAsOwner
.When a namespace is created, Capsule checks if the requester is owner of the Tenant, or if the Tenant has the
actAsOwner
flag set to true.If so, the requester is allowed to create the namespace.
Here is a the Tenant used for testing:
While this PR was being developed, we had a talk about what
actAsOwner
means. And where it should be.In the discussion we aired a few places, and talked about the differences between them.
We believe the name and placement, should reflect what a delveoper would expect it to do.
And so we came up with a new idea, which would fit more in with the default of how the
owners
field works.I'll paste a yaml example of how it could look like:
The pros of the solution as it is this PR, the flag would be set, in the same place as the rolebindings are set.
The also means if the role giving does not have the RBAC to create a namespace, it would not be able to create a namespace.
In the second solution, the
nameSpaceProvisioner
would be a new field, which would be a list of subjects, which would be allowed to create namespaces.This would match how
owners
works, and would be more intuitive for a developer to understand.I would like to hear your thoughts on this, and if you have any other ideas on how to implement this feature.
The PR is set to WIP, as I still don't think we have settled on the best solution. And I think it's better to talk from code.