refactor: simplify middleware code
following code review feedback. pkg/middlewares/aws_route_table_expander.gomain
parent
257c1260dd
commit
5f60cf44bc
|
@ -224,15 +224,9 @@ func (m *AwsRouteTableExpander) handleDefaultTable(table *aws.AwsDefaultRouteTab
|
||||||
|
|
||||||
func (m *AwsRouteTableExpander) routeExists(routeId string, resourcesFromState []resource.Resource) bool {
|
func (m *AwsRouteTableExpander) routeExists(routeId string, resourcesFromState []resource.Resource) bool {
|
||||||
for _, res := range resourcesFromState {
|
for _, res := range resourcesFromState {
|
||||||
if res.TerraformType() != aws.AwsRouteResourceType {
|
if res.TerraformType() == aws.AwsRouteResourceType && res.TerraformId() == routeId {
|
||||||
continue
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if res.TerraformId() != routeId {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue