Skip to content

Commit

Permalink
Merge pull request #588 from vmware/fix-vrf-realization
Browse files Browse the repository at this point in the history
Dont assign VRF route targets unless specified
  • Loading branch information
annakhm authored Mar 10, 2021
2 parents 639c7f0 + 44fb89f commit 7365c6e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions nsxt/resource_nsxt_policy_tier0_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,13 +454,15 @@ func getPolicyVRFConfigFromSchema(d *schema.ResourceData) *model.Tier0VrfConfig
exportTargets := interface2StringList(routeTarget["export_targets"].([]interface{}))
importTargets := interface2StringList(routeTarget["import_targets"].([]interface{}))
// Only one is supported for now
targets := model.VrfRouteTargets{
AddressFamily: &addressFamily,
ExportRouteTargets: exportTargets,
ImportRouteTargets: importTargets,
}
if len(exportTargets)+len(importTargets) > 0 {
targets := model.VrfRouteTargets{
AddressFamily: &addressFamily,
ExportRouteTargets: exportTargets,
ImportRouteTargets: importTargets,
}

config.RouteTargets = []model.VrfRouteTargets{targets}
config.RouteTargets = []model.VrfRouteTargets{targets}
}
}

if vni > 0 {
Expand Down

0 comments on commit 7365c6e

Please sign in to comment.