Closed RussPitcher closed 1 year ago
Thanks for the investigation. we were aware of the problem, but this function skipped through the cracks last time we went around fixing it.
There is a simple fix (we do have a cumulativeQuery
that does the pagination automatically). It will require some tests, but it should be addressed easily.
Fixed with PR #518
Describe the bug
When running a Terraform action against an OrgVDC with more than 25 OrgVDC networks the state refresh fails with one or more errors as follows:
Error: error retrieving network myOrgVdcNetwork from network list
On investigation we discovered that the query used to retrieve the network list does not manage paged responses and therefore uses the default page size of 25 records. Any records apart from the initial 25 are not returned. This causes the calling functions to fail when the expected network is missing.
We tracked the REST call down to the
GetNetworkList()
function in theorgvdcnetwork.go
file and it can be seen that the pageSize parameter is not used, and the function itself does not attempt to handle paged responses.Reproduction steps
vdc_network_direct
objectsterraform plan
Expected behavior
The terraform plan should refresh the state successfully without errors
Additional context
Adding a simple
"pageSize": "128"
to the query would reduce the scope of this issue (as has been done in theQueryProviderVdcStorageProfileByName
function) but it would be better to implement proper support for paged responses.