Skip to content

Commit

Permalink
Merge pull request #580 from vmware/fix-route-map
Browse files Browse the repository at this point in the history
Always allow to specify set in route map criteria
  • Loading branch information
annakhm authored Mar 8, 2021
2 parents 7860cf2 + b22346d commit 2d1d7ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nsxt/resource_nsxt_policy_gateway_route_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func policyGatewayRouteMapBuildEntry(schemaEntry map[string]interface{}) model.R
}

commListMatches := schemaEntry["community_list_match"].([]interface{})
prefixListMatches := schemaEntry["prefix_list_matches"].(*schema.Set).List()

if len(commListMatches) > 0 {
var commCriteriaList []model.CommunityMatchCriteria
Expand All @@ -183,12 +184,11 @@ func policyGatewayRouteMapBuildEntry(schemaEntry map[string]interface{}) model.R
}

obj.CommunityListMatches = commCriteriaList
} else if len(prefixListMatches) > 0 {
obj.PrefixListMatches = interfaceListToStringList(prefixListMatches)
}

prefixListMatches := schemaEntry["prefix_list_matches"].(*schema.Set).List()
if len(prefixListMatches) > 0 {
obj.PrefixListMatches = interfaceListToStringList(prefixListMatches)
} else if len(schemaEntry["set"].([]interface{})) > 0 {
if len(schemaEntry["set"].([]interface{})) > 0 {
data := schemaEntry["set"].([]interface{})[0].(map[string]interface{})
asPathPrepend := data["as_path_prepend"].(string)
community := data["community"].(string)
Expand Down

0 comments on commit 2d1d7ac

Please sign in to comment.