terraform-provider-vcd icon indicating copy to clipboard operation
terraform-provider-vcd copied to clipboard

Unable to reference specific catalog if there are multiple ones with the same name

Open schmaxit opened this issue 2 years ago • 1 comments

Catalog sharing allows having multiple catalogs with the same name accessible to a single org. In this case there isn't a way to select a specific one when referencing it in the vcd_vm or vcd_vapp_vm resource.

Maybe we shouldn' t use org.GetCatalogByName but some more specific function like org.GetCatalogId or org.GetCatalogByNameOrId

https://github.com/vmware/terraform-provider-vcd/blob/89bcdc8abb7a31d33e972b02f94a077da93ccb93/vcd/resource_vcd_vapp_vm.go#L634

schmaxit avatar Apr 08 '22 08:04 schmaxit

Hello @schmaxit You are right, we should use ID instead of names.

Catalogs names are unique per Orgs, so probably when that code was develop, the sharing feature wasn't yet in VCD. We are aware of the situation ad for us is technical debt that at some point needs to be addressed.

mikeletux avatar Apr 28 '22 11:04 mikeletux

Closing this as v3.8.0 has vcd_catalog_vapp_template and vcd_vapp_vm accept its ID instead of names.

Didainius avatar Nov 28 '22 12:11 Didainius