Repository navigation
feat(cli): butleradm team member-role + group access rules - #56
Merged
Merged
Conversation
Add four verbs to the butleradm team group, completing CLI parity with the console for Team access management (previously add-member/remove-member only): - team update-member-role NAME --email E --role R: change a member's role. - team add-group NAME --group G --role R [--identity-provider IDP]: add a group-to-role access rule. - team update-group-role NAME --group G --role R [--identity-provider IDP]: change a group rule's role. - team remove-group NAME --group G [--identity-provider IDP]: remove a rule. All are CRD-direct edits to spec.access (Get, modify the targeted slice entry, Update the same object), so status and resourceVersion are preserved without a separate merge. The user identifier in spec.access.users is the name field, which holds the email. A group rule is identified by name plus optional identityProvider. When more than one rule shares a name and no --identity-provider is given, update-group-role and remove-group error and ask the operator to disambiguate rather than editing the wrong rule. Maps to the last open P1 in the CLI/console gap audit.
Contributor
Author
Live E2E validation (butler-beta)Full lifecycle exercised CRD-direct against the real management apiserver, on a throwaway team (
No verb failed live. The status/resourceVersion preservation on update-member-role and the fail-safe ambiguity error on remove-group both held against the real apiserver. |
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.
Team member-role update + group access rules
Maps to audit P1 #7 (the last open P1 in the CLI/console gap audit). Completes CLI parity with the console for Team access management:
butleradm teamhad add-member/remove-member but no way to change a member's role or manage group access rules.Verbs (all CRD-direct, pure-CLI)
team update-member-role NAME --email E --role Rteam add-group NAME --group G --role R [--identity-provider IDP]team update-group-role NAME --group G --role R [--identity-provider IDP]team remove-group NAME --group G [--identity-provider IDP]Mechanism
All four are CRD-direct edits to
Team.spec.access, mirroring the existing add-member/remove-member: Get the Team, modify the targeted entry in theusers/groupsslice,SetNestedSlice, and Update the same object. Because the Update carries the same fetched object, status and resourceVersion are preserved without a separate merge step. No serverhttp, no auth-track exposure.Field-path note: the user identifier in
spec.access.users[]is thenamefield (it holds the email), notemail.Group identity is
(name + optional identityProvider)A group rule can be scoped to a specific IdP.
update-group-roleandremove-groupmatch on name, plus identityProvider when--identity-provideris given. When multiple rules share a name and no--identity-provideris given, they error and ask the operator to disambiguate rather than editing the wrong rule. This fails safe.Decisions
Tests
editMemberRolepreserves status + resourceVersion + the other member (mutation-checked: clobbering status/rv fails).Pending: live E2E against butler-beta before merge.