Skip to content

fix: store the cidr set in the managed egress firewall dummy rule - #348

Open
nagaboinaramgopal wants to merge 1 commit into
apache:mainfrom
nagaboinaramgopal:fix/egress-firewall-cidr-list-set
Open

fix: store the cidr set in the managed egress firewall dummy rule#348
nagaboinaramgopal wants to merge 1 commit into
apache:mainfrom
nagaboinaramgopal:fix/egress-firewall-cidr-list-set

Conversation

@nagaboinaramgopal

Copy link
Copy Markdown
Contributor

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.

For a managed egress firewall, Read collects unknown rules into a dummy rule, but stored the uuid string in cidr_list, which is a schema.TypeSet and must hold a *schema.Set. It builds one (cidrs) right above for this, so use it. With the string, reading a managed egress firewall panics with interface conversion: interface {} is string, not *schema.Set.
@nagaboinaramgopal
nagaboinaramgopal force-pushed the fix/egress-firewall-cidr-list-set branch from 2b44025 to 02f9daa Compare September 7, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant