Skip to content
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 metadata support to Provider VDC #1126

Merged
merged 17 commits into from
Nov 7, 2023

Conversation

adambarreiro
Copy link
Collaborator

@adambarreiro adambarreiro commented Oct 5, 2023

Description

This PR adds the attribute metadata_entry to the vcd_provider_vdc resource.

Solution

The difficulty of this one is the fact that vcd_provider_vdc is the only resource we have that does not have the old and deprecated metadata attribute. For that reason, this PR adapts the current code to accommodate this new casuistic:

  • There's a completely new schema for resources that do not have old metadata attribute. The reason is that these don't need any Computed value (as we don't need to have both things co-living). Also the new schema takes advantage of Terraform built-ins like Required or Default that were not possible in the previous schema, also due to compatibility reasons.

  • The testing framework for metadata is adapted to be able to skip the steps that test old metadata, as this does not exist in the new kind of resources.

  • Other minor refactors, like function splitting, have been done.

Tests

  • New tests passed on 10.5.0
  • Passed: Partial metadata tests
go test -tags functional -run '^TestAcc.*Metadata' -v -timeout 0
  • Passed: All metadata tests with TEST_VCD_METADATA_IGNORE=1
TEST_VCD_METADATA_IGNORE=1 go test -tags functional -run '^TestAcc.*Metadata' -v -timeout 0
  • Run some manual tests: Check that ignore_metadata_changes works, try different combinations.

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>
@adambarreiro adambarreiro self-assigned this Oct 20, 2023
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro marked this pull request as ready for review October 20, 2023 12:09
vcd/metadata.go Outdated Show resolved Hide resolved
vcd/metadata.go Outdated Show resolved Hide resolved
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>
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will trust you on running tests for whole suite, but I have attempted to use metadata_entry in vcd_provider_vdc resource and data source manually - that worked.

@adambarreiro
Copy link
Collaborator Author

I will trust you on running tests for whole suite, but I have attempted to use metadata_entry in vcd_provider_vdc resource and data source manually - that worked.

I'll probably have to re-run everything as this one clashes with #1146 😄

Copy link
Collaborator

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full acceptance tests pass in 10.5

vcd/resource_vcd_provider_vdc_test.go Outdated Show resolved Hide resolved
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro merged commit 9f31130 into vmware:main Nov 7, 2023
3 checks passed
@adambarreiro adambarreiro deleted the provider-vdc-metadata branch November 7, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants