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 generic CRUD metadata by href functions #454

Merged
merged 11 commits into from
Apr 6, 2022

Conversation

adambarreiro
Copy link
Collaborator

Signed-off-by: abarreiro abarreiro@vmware.com

This PR relates to vmware/terraform-provider-vcd#372, as the goal is to provide CRUD functions for metadata to resources that don't have an associated type, like Storage profiles.

The functions just retrieve an HREF instead, and perform the metadata operation on it.

Another way of doing this would be changing the signature to:

func (reference *types.Reference) AddMetadataEntryByHrefAsync(typedValue, key, value string) {
// Use reference.HREF here

But I followed the approach of having this method associated to VCDClient instead. (This is, of course, open to discussion).

Signed-off-by: abarreiro <abarreiro@vmware.com>
abarreiro added 2 commits April 4, 2022 13:02
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro self-assigned this Apr 4, 2022
@adambarreiro adambarreiro marked this pull request as ready for review April 4, 2022 12:54
@adambarreiro adambarreiro removed the request for review from dataclouder April 4, 2022 12:54
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.

Missing changelog entry.

abarreiro added 4 commits April 4, 2022 15:10
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.

Looks great!

Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Copy link
Contributor

@mikeletux mikeletux left a comment

Choose a reason for hiding this comment

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

LGTM! Approved!

abarreiro added 2 commits April 5, 2022 18:13
Signed-off-by: abarreiro <abarreiro@vmware.com>
…ctor into add-metadata-by-href

Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro merged commit d3a0c52 into vmware:main Apr 6, 2022
@adambarreiro adambarreiro deleted the add-metadata-by-href branch April 6, 2022 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants