nagaboinaramgopal opened a new pull request, #343:
URL: https://github.com/apache/cloudstack-terraform-provider/pull/343
### Description
`domain_id` on `cloudstack_network_offering` is a `schema.TypeList`, so the
SDK returns `[]interface{}`, but both call sites asserted the wrong type.
Create asserted `v.([]string)` and update asserted
`d.Get("domain_id").(string)`, so setting or changing `domain_id` panics the
provider with `interface conversion: interface {} is []interface {}, not
[]string` on create (and `not string` on update). Fixed by building a
`[]string` for create, where `SetDomainid` takes `[]string`, and a comma-joined
string for update, where `SetDomainid` takes `string`.
### Testing
Added a unit test `TestNetworkOfferingDomainIdDoesNotPanic` that runs the
create function with `domain_id` set against an unreachable endpoint. It needs
no live CloudStack:
go test ./cloudstack/ -run TestNetworkOfferingDomainIdDoesNotPanic
It panics against the current code and passes with the fix.
--
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]