-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix group.Update() when users list is populated #449
Conversation
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Also add a note to changelog. |
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p.s. Found during one of the test-fests.
Done, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LDAP related tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Approved 😄
Description
Let's consider that we're working with LDAP users and groups. When a group is read from LDAP, and it contains users, the attribute UsersList is populated with the names of these users. The problem is, if the group is updated, and the users list is sent back, VCD will throw this error:
The proposed fix is to send this attribute always to
nil
in thegroup.Update()
function.I've also checked what happens with
user.Update()
, as common sense would suggest that the behaviour is the same, but it is not. In fact, there's already a check kind of similar to the one proposed, in user.go:414.In this case,
user.Update()
worked out of the box, so I haven't touched that part. What I did, in the other hand, is enrich the group test with anuser.Update()
call, to have this behaviour covered as well.