Skip to content

Commit

Permalink
Do not set AS number in BGP unless specified
Browse files Browse the repository at this point in the history
Due to platform validations, AS number needs to remain nil
unless specified. In order to avoid non-empty diff when AS
is set by platform, we need to define this attribute as
computed.
Signed-off-by: Anna Khmelnitsky <[email protected]>
  • Loading branch information
annakhm committed Jun 8, 2022
1 parent cb1053c commit 6d32ae8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nsxt/resource_nsxt_policy_bgp_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ func resourceNsxtPolicyBgpConfigToStruct(d *schema.ResourceData, isVRF bool) (*m

routeStruct.Tags = tags
routeStruct.InterSrIbgp = &interSrIbgp
routeStruct.LocalAsNum = &localAsNum
if len(localAsNum) > 0 {
routeStruct.LocalAsNum = &localAsNum
}
routeStruct.MultipathRelax = &multipathRelax
routeStruct.GracefulRestartConfig = &restartConfigStruct
}
Expand Down
1 change: 1 addition & 0 deletions nsxt/resource_nsxt_policy_tier0_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func getPolicyBGPConfigSchema() map[string]*schema.Schema {
Description: "BGP AS number in ASPLAIN/ASDOT Format",
Optional: true,
ValidateFunc: validateASPlainOrDot,
Computed: true,
},
"multipath_relax": {
Type: schema.TypeBool,
Expand Down

0 comments on commit 6d32ae8

Please sign in to comment.