vmware / go-vcloud-director

Golang SDK for VMware Cloud Director
Other
79 stars 76 forks source link

Patch GetSpecificApiVersionOnCondition to respect minimum API version (client.APIVersion) #658

Closed Didainius closed 5 months ago

Didainius commented 6 months ago

This is a continuation of #639. The function GetSpecificApiVersionOnCondition did not respect minimum API version. This PR fixes the function so that we don't have errors waiting to happen like it was in #636 case. Also it simplifies API calls that used GetSpecificApiVersionOnCondition that are not relevant anymore.

Note

When client.APIVersion is bumped, this function may use newer API version than the constraints defined therefore one must test the code.

Testing

Tests passed on 10.5.1.1 with only known anomalies:

FAIL: org_saml_test.go:112: TestVCD.TestClient_RetrieveRemoteDoc
FAIL: vm_test.go:2047: TestVCD.Test_GetOvfEnvironment
FAIL: nsxt_l2_vpn_tunnel_test.go:16: TestVCD.Test_NsxtL2VpnTunnel
Didainius commented 5 months ago

Thank you. Please add a note for reference to PR description too (about the risk involved in using this function without retesting on newer VCD versions).

Added