-
Notifications
You must be signed in to change notification settings - Fork 79
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 ability to ignore metadata to SDK client configuration #581
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>
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.
- Missing changelog
I have a few queries and requests inline
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.
Thanks!
I am good in general.
I have left a few comments how to fix my own suggestion at it was more complicated than I though:)
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.
LGTM.
I am just asking to do one small correction
Context
This PR implements the foundational logic to be able to implement metadata ignoring in the VCD Terraform Provider: vmware/terraform-provider-vcd#1057
Description
The metadata to ignore lives inside the SDK
Client
as a slice of a new structure calledIgnoredMetadata
. This slice can be populated with the newWithIgnoredMetadata
function.The
IgnoredMetadata
slice is then read in all metadata_v2.go methods. There are three methods to filter metadata:filterMetadata
, in short it callsfilterSingleMetadataEntry
on every entry of the metadata slice given as an input.filterSingleMetadataEntry
filters a single metadata entry. Here, the way that it works is that it considers that a metadata entry should be always ignored if theIgnoredMetadata
entries don't say the opposite. This allows to have all fields inIgnoredMetadata
to be optional (they're pointers) and compute all rules with an AND.filterMetadataToDelete
controls the special case of metadata deletion, as we only have a Key here, we need to retrieve the Value if the entry is a good candidate to be removed.