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 catalog details represeting properties as computed fields #800

Merged
merged 37 commits into from
Mar 25, 2022

Conversation

mikeletux
Copy link
Contributor

@mikeletux mikeletux commented Mar 4, 2022

This PR aims to address the enhancements proposed by @vbauzysvmware on github issue #365 .

Description

According to the issue above mentioned, 7 new computed fields have been added to catalog resource and datasource.

Detailed description

The new computed fields for catalog resource and datasource are:

  • catalog_version - Version number from this catalog.
  • owner_name - Owner of the catalog.
  • number_of_vapp_templates - Number of vApp templates available in this catalog.
  • number_of_media - Number of media items available in this catalog.
  • is_shared - Indicates if the catalog is shared.
  • is_published - Indicates if this catalog is shared to all organizations.
  • publish_subscription_type - Shows if the catalog is published, if it is a subscription from another one or none of those.

This PR relays on vmware/go-vcloud-director#450

@mikeletux
Copy link
Contributor Author

Changelog as well as docs still need to be put in place.

@mikeletux mikeletux removed the request for review from vbauzys March 4, 2022 09:39
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

One polishing nit and LGTM!

vcd/resource_vcd_catalog.go Outdated Show resolved Hide resolved
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.

Lucky number #800 :)

This looks good. I have a few queries and an ask before I get to manual test

vcd/datasource_vcd_catalog.go Outdated Show resolved Hide resolved
vcd/datasource_vcd_catalog.go Outdated Show resolved Hide resolved
vcd/datasource_vcd_catalog.go Outdated Show resolved Hide resolved
vcd/resource_vcd_catalog.go Show resolved Hide resolved
vcd/resource_vcd_catalog.go Show resolved Hide resolved
vcd/resource_vcd_catalog.go Outdated Show resolved Hide resolved
@mikeletux
Copy link
Contributor Author

Also upgraded catalog datasource so org attribute is optional, so users can use from now on either the org at provider level or the one at datasource level.

Miguel Sama added 8 commits March 25, 2022 10:27
…of_media to catalog resource schema

Signed-off-by: Miguel Sama <[email protected]>
…of_media to resource schema

Add test for number_of_vapp_templates and number_of_media

Signed-off-by: Miguel Sama <[email protected]>
Signed-off-by: Miguel Sama <[email protected]>
Remove owner from catalog resource due to issues with API

Signed-off-by: Miguel Sama <[email protected]>
@mikeletux mikeletux force-pushed the catalog-properties branch from 7c5f9ca to e6741a8 Compare March 25, 2022 09:53
@vbauzys
Copy link
Contributor

vbauzys commented Mar 25, 2022

One more thing I would like to have: read part of setting values to the state of data source and source seems are very similar. We could make one function and reuse it. We have quite often that in our provider.

Miguel Sama added 2 commits March 25, 2022 11:40
…e code twice in catalog resource and datasource

Signed-off-by: Miguel Sama <[email protected]>
…e code twice in catalog resource and datasource

Signed-off-by: Miguel Sama <[email protected]>
@mikeletux
Copy link
Contributor Author

One more thing I would like to have: read part of setting values to the state of data source and source seems are very similar. We could make one function and reuse it. We have quite often that in our provider.

@vbauzysvmware Done!
I added a new function called setCatalogRecordValuesToSchema that it's being used in both the resource and the datasource!

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.

Thanks!

Signed-off-by: Miguel Sama <[email protected]>
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