fix(group): report a member the server dropped instead of claiming it was added - #257
Merged
Merged
Conversation
… was added erchef accepts a group PUT that names an actor it cannot find, silently drops that name, and answers with the body as sent. group member add therefore printed "Added bob, ghost to group ..." and exited 0 when the ghost user never joined. After an add the command now reads the group back, reports only the members it holds, and fails naming any the server dropped so a typo or a missing actor is noticed. Signed-off-by: Tim Smith <tsmith84@proton.me>
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.
erchef accepts a group PUT that names an actor it can't find. It silently drops that name, and it answers with the request body as sent.
cinc group member add admins bob ghost --type clienttherefore printed:and exited 0, even though
ghostnever joined.After an add, the command now reads the group back and splits the names it sent into the ones the group holds and the ones the server dropped. It reports only the members that were actually added, and fails naming any that were dropped:
removeis unchanged: removing a name that isn't in the group was already reported as "No change".This wasn't noticed before because cinc-server-ng used to store unknown members, which kept the
groups/member-unknowncase gapped. v0.14.0 drops them the way erchef does (#255), which exposed the CLI side. This PR removes that gap.Tests
TestGroupMemberAddReportsDroppedMembersuses a fake server that, like erchef, drops unknown names and echoes the request body.groups/member-unknownpasses against cinc-server-ng v0.14.0 and is off the gap list.