nagaboinaramgopal opened a new pull request, #348:
URL: https://github.com/apache/cloudstack-terraform-provider/pull/348
### Description
For a managed egress firewall, Read collects the unknown rules into a single
dummy rule. `cidr_list` is a `schema.TypeSet`, so its value must be a
`*schema.Set`, and the code even builds one (`cidrs`) right above for exactly
this. But the dummy rule stored the uuid string in `cidr_list` instead, so
reading a managed egress firewall panics with `interface conversion: interface
{} is string, not *schema.Set`. Use the `cidrs` set.
### Testing
Added a unit test `TestEgressFirewallReadManagedDummyRuleCidrListIsSet` that
reads a managed egress firewall, via a stub server returning one rule, and
asserts each rule's `cidr_list` is a `*schema.Set`. It needs no live CloudStack:
go test ./cloudstack/ -run
TestEgressFirewallReadManagedDummyRuleCidrListIsSet
Before the fix the read panics on the string; after it, the read succeeds.
--
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]