feat(teamrolebindings): allow changing namespaces for teamrolebindings #813
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.
Description
This PR allows changes to the .Spec.Namespaces of TeamRoleBinding. Namespaces can be changed, but the webhook denies changing the TRB from cluster-scoped to namespace-scoped (by changing initially empty Namespaces) and vice versa (by removing all namespaces).
Changes to the Namespaces of TRB are reconciled by the TeamRoleBindingController. The removal of RoleBindings from the remote cluster changed to not only relying on .Spec.Namespaces, but to take into account the RoleBindings that could've been deployed before the change (now checked by the name of RoleBindings deployed).
What type of PR is this? (check all applicable)
Related Tickets & Documents
Added tests?
I've added tests for the TeamRoleBinding controller and the TeamRoleBinding webhook.
Added to documentation?
Checklist