fix: mark subnets with implicit igw association as public #3269
fix: mark subnets with implicit igw association as public #3269mergify[bot] merged 4 commits intoaws:mainlinefrom
Conversation
| routeTableForSubnet: make(map[string]*routeTable), | ||
| } | ||
| for _, table := range tables { // Index all properties in a single pass. | ||
| table := (*routeTable)(table) |
There was a problem hiding this comment.
do we need to check the type in case the type can't be asserted?
There was a problem hiding this comment.
no need boss it's a compile type check
| } | ||
|
|
||
| // AssociatedSubnets returns the list of subnet IDs associated with the route table. | ||
| func (rt *routeTable) AssociatedSubnets() []string { |
There was a problem hiding this comment.
Does this function have to be public? same for the other new added public functions.
There was a problem hiding this comment.
The type itself is private so I don't think it particularly matters since it doesn't get exposed by the package 🤷 do you know if there is a particular benefit?
I marked it as public to indicate that they can be used by clients, and i would mark it as private if only *routeTable should use it
| // If a subnet is not associated with a particular route table, then it will default to the main route table. | ||
| func (rt *routeTable) IsMain() bool { | ||
| for _, association := range rt.Associations { | ||
| if aws.BoolValue(association.Main) { |
There was a problem hiding this comment.
hmm I wonder why Main is an attribute of association but not routeTable. Sounds to me the latter makes much more sense 😅
There was a problem hiding this comment.
That's a great point 😅 I have no idea why it's like that
Fixes #3266
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.