-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route-map with set block sets local preference and MED to 0 by default #813
Comments
My Go is very rusty, and I know very little of TF providers, but I think a fix could look something like this: "local_preference": {
Type: schema.TypeInt,
Optional: true,
Description: "Local preference indicates the degree of preference for one BGP route over other BGP routes",
Default: -1,
},
"med": {
Type: schema.TypeInt,
Optional: true,
Description: "A lower Multi exit descriminator (MED) is preferred over a higher value",
Default: -1,
}, entrySet := model.RouteMapEntrySet{
PreferGlobalV6NextHop: &globalIPv6,
Weight: &weight,
}
if med > -1 {
entrySet.Med = &med
}
if localPreference > -1 {
entrySet.LocalPreference = &localPreference
} It appears the default value for P.S. - |
Thanks for reporting this @ens-scmeeu! Also appreciate your fix suggestion, however I'd rather not set a |
Describe the bug
When using an
nsxt_policy_gateway_route_map
resource with aset
block, but without explicitly settinglocal_preference
, local preference will be set to 0. It appears from looking at the source code that it is not conditionally set as I would expect, but always set in the presence of aset
block. My assumption is that this structure is using a default value of 0 for local preference, which then causes it to be incorrectly modified.UPDATE: The same issue applies to med. It should not be being reset either unless explicitly set. See below for a possible (but not quite ideal) fix.
Reproduction steps
nsxt_policy_gateway_route_map
with aset
block, matching all routes. Do not setlocal_preference
.nsxt_policy_bgp_neighbor
inroute_filtering
block viain_router_filter
Expected behavior
When not explicitly set in the route-map, BGP local preference should not be set. All implementations I'm aware of (including NSX-T) will then set local preference to 100 by default on receipt of the route (for eBGP neighbors that is, iBGP neighbors will preserve the existing value of the attribute).
Additional context
No response
The text was updated successfully, but these errors were encountered: