nagaboinaramgopal opened a new pull request, #339:
URL: https://github.com/apache/cloudstack-terraform-provider/pull/339

   ### Description
   
   `resourceCloudStackNetworkOfferingUpdate` was broken in two ways, and 
updating a `cloudstack_network_offering` failed outright:
   
   1. Each `UpdateNetworkOffering` call built its params with 
`NewUpdateNetworkOfferingParams()` but never set the offering id, so every 
update (name, display_text, max_connections, domain_id) failed with:
   
           CloudStack API error 530 (CSExceptionErrorCode: 9999): Cannot invoke
           "java.lang.Long.longValue()" because "id" is null
   
      Fixed by setting the id on each params struct.
   
   2. After updating, the function returned `resourceCloudStackInstanceRead`, 
the read function for the `cloudstack_instance` resource, which looks up a VM 
by the network offering id and corrupts the resource state. Fixed to return 
`resourceCloudStackNetworkOfferingRead`, matching the Create and Read paths.
   
   ### Testing
   
   Added an acceptance test `TestAccCloudStackNetworkOffering_update` that 
creates a network offering and then updates its `display_text`. It fails before 
this change (the `id is null` API error) and passes after.
   
   Verified end to end against a live CloudStack advanced zone:
   
           TF_ACC=1 go test ./cloudstack/ -run 
TestAccCloudStackNetworkOffering_update
           --- PASS: TestAccCloudStackNetworkOffering_update
   
   `go build ./...`, `go vet ./...`, and the unit suite (`go test 
./cloudstack/`) also pass.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to