-
Notifications
You must be signed in to change notification settings - Fork 112
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 resource list usage of "parent" with entities depending on Org #1140
Fix resource list usage of "parent" with entities depending on Org #1140
Conversation
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
* Add "parent" field into consideration when "org" is empty * Use client.GetAdminOrg, which uses the provider "org" field if the above ones are empty. * client.GetAdminOrg also returns a better error message Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@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.
Thanks for the fix!
Is there a reason why org defined at provider level is not used? Is it just for resource and not for datasource?
|
It is for both. The reason it was not used is just a plain bug. |
Oh yes, you already wrote it. |
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Entities depending directly on an organization should use the
"org"
field to identify its parent.The
"parent"
field, which is intended for intermediate entities, should not be used for this purpose.However, if users fill the "parent" field instead of "org", they get an ambiguous error, which doesn't explain what has happened.
This change allows
vcd_resource_list
to consider both"org"
and"parent"
fields, as well as the"org"
field in the provider block.The change is transparent for users. If the
"parent"
field was used instead of"org
", the organization is retrieved without complaints. In case of error, they get a clear message about what is missing.