-
Notifications
You must be signed in to change notification settings - Fork 452
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
Sorting permissions object on username/group name before storing. #1311
Sorting permissions object on username/group name before storing. #1311
Conversation
…better user experience.
Hey @sumitAgrawal007, I am trying to understand this change and I think I need some additional context. If I understand correctly the only thing this PR does it to sort the list of roles before setting it in the Read() function. Is there any actual effect on vSphere by this change? What I'm concerned is that if users ignored the advice and did not sort their roles alphabetically, then once they run this version of the provider their plan will reports that changes are required, which may or may not be true. We could use a diff suppress func where we sort the list in the config and the list we get from vsphere and if they're equal then we just don't report back as a difference but, again, I need your help to understand the consequences of such a thing. |
No, there is no affect on vsphere by this change. The reason of this change is that even if the user sorts his persmission in the configuration file, still the vsphere server returns them in unsorted/arbit way, and terraform plan reports that there are going to be changes. So the best way to handle these issues is to suggest the user to sort them in .tf file and sort the server response as well. So I am also going to add a diff surpress function here, to make it complete. |
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.
Had a quick question about the slice trick I noticed? Other than that LGTM!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Description
The permissions objects received from server are not necessarily sorted on username/groupname. We are asking the users to keep it sorted in the TF file and this PR sorts the received objects alphabetically so that terraform doesn't show a diff while refreshing.
Acceptance tests
Release Note
Release note for CHANGELOG:
References
Closes #1293