vmware / cloud-provider-for-cloud-director

Kubernetes External Cloud Provider for VMware Cloud Director
Other
20 stars 30 forks source link

[VKCI-306] get the gateway using the org object instead of the VDC #360

Closed Anirudh9794 closed 8 months ago

Anirudh9794 commented 8 months ago

If the OVDC network is a DC group network, vdc.GetNsxtEdgeGatewayByName(edgeGatewayName) will return "EntityNotFound" error. This is because the govcd function will internally filter with "ownerRef.id=="+vdc.Vdc.ID and the ownerRef.id in case of a DC group network is the ID of the DC group.

The solution used in this PR is to use the org GoVCD object to fetch the edgeGateway object.

Testing: Used this code in CAPVCD and saw that a right response is given for IsUsingIPSpace() function

rocknes commented 8 months ago

Thanks for making the change :)