-
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
Add support to metadata that is automatically added by VCD #1146
Add support to metadata that is automatically added by VCD #1146
Conversation
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
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.
Looks to be a tidy approach to work around the change in API behavior!
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
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.
The new "map" approach looks great and versatile!
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
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 this improvement! Also really like the new TestCheckFuncs with version constraint!
Context
In the most recent versions of VCD, standalone VMs that are created from a vApp Template come with three metadata entries that are created automatically by VCD:
vm.origin.id
,vm.origin.name
andvm.origin.type
.This conflicts with the way metadata works in this Terraform provider, as any plan will ask to remove these "foreign" entries if one adds metadata to their VMs in their HCL configuration.
Solution
To avoid a bad experience when dealing with this casuistic, this metadata is filtered out from
metadata
andmetadata_entry
blocks and moved to a separated block only available invcd_vapp_vm
andvcd_vm
. This block is completely Computed and available for reading.Tests
Tests fail in the newest VCD versions as the expected metadata is n-3. After this feature, as metadata is filtered out, we get these n-3 entries and the removed 3 are in a separated block, which gets its own set of assertions.
vm
acceptance tests pass 10.5.0vm
tag upgrade tests pass 10.5.0vm
acceptance tests pass on latest versionvm
tag upgrade tests pass on latest version