Skip to content

Commit

Permalink
Always allow to specify set in route map criteria
Browse files Browse the repository at this point in the history
Set can be configured regardless of criteria type
  • Loading branch information
annakhm committed Mar 2, 2021
1 parent b2d974e commit b22346d
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 b22346d

Please sign in to comment.