-
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 new argument to Provider configuration to ignore metadata entries #1057
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>
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.
I have reviewed the 26 commits done after my last review and it all feels right and further improved!
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.
2nd approval.
I have manually tested metadata conflict situation and double checked the origin
field change.
To reiterate a note of caution about create
calling update
. We do not want to do it because of how messy and painful it becomes to deal with it (#901). Yet we still have some places where it happens (and is needed) from a long long time ago.
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.
Thanks for the feature!
Closes #959
Requires https://github.com/vmware/go-vcloud-director/pull/581/files
This PR adds a new argument to the Terraform VCD Provider configuration:
ignore_metadata_changes
, which accepts the following sub-arguments:resource_type
: Optional, specifies the resource type which metadata needs to be ignored. If set, the resource type must be one of:"vcd_catalog", "vcd_catalog_item", "vcd_catalog_media", "vcd_catalog_vapp_template", "vcd_independent_disk", "vcd_network_direct",
"vcd_network_isolated", "vcd_network_isolated_v2", "vcd_network_routed", "vcd_network_routed_v2", "vcd_org", "vcd_org_vdc", "vcd_provider_vdc",
"vcd_storage_profile", "vcd_vapp", "vcd_vapp_vm" or "vcd_vm", which are the resources compatible with
metadata_entry
.Any other resource type will not have effect.
resource_name
: Optional, specifies the name of the object which metadata needs to be ignored. All object types are supported, except forvdcStorageProfile
which cannot be filtered by name.key_regex
: Optional, it is a regular expression that can filter out metadata keys that match.value_regex
: Optional, it is a regular expression that can filter out metadata keys that match.conflict_action
: Optional, defines what to do if a conflict exists between ametadata_entry
that is managedby Terraform, and it matches the criteria defined in the
ignore_metadata_changes
block, as the metadata will be stored in state but nothing will be done in VCD. If the value iserror
, when this happens, the Plan will fail. When the value iswarn
, it will just give a warning but the Plan will continue, and with thenone
value nothing will be shown. Defaults toerror
.Either
key_regex
orvalue_regex
are required on everyignore_metadata
block.Example
Acceptance tests passed on VCD versions: TBD