Skip to content

Commit

Permalink
Adjust the provider for NSX 3.2 release
Browse files Browse the repository at this point in the history
Some breaking changes were introduced in new release, including:
* always populating advanced config in segments
* changing default to lowercase in gateway route map

In order to avoid non-empty diff, segment resource would now rely
on terraform config in order to determine whether advanced settings
should be brought into state.

Signed-off-by: Anna Khmelnitsky <[email protected]>
  • Loading branch information
annakhm committed Sep 13, 2021
1 parent ece9277 commit 4e4b2bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nsxt/resource_nsxt_policy_gateway_prefix_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func setPrefixesInSchema(d *schema.ResourceData, prefixes []model.PrefixEntry) {
elem["action"] = *prefix.Action
elem["ge"] = prefix.Ge
elem["le"] = prefix.Le
if *prefix.Network == "ANY" {
if *prefix.Network == "ANY" || *prefix.Network == "any" {
elem["network"] = ""
} else {
elem["network"] = prefix.Network
Expand Down
5 changes: 4 additions & 1 deletion nsxt/segment_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,10 @@ func nsxtPolicySegmentRead(d *schema.ResourceData, m interface{}, isVlan bool, i
// This is a list with 1 element
var advConfigList []map[string]interface{}
advConfigList = append(advConfigList, advConfig)
d.Set("advanced_config", advConfigList)
userConfig := d.Get("advanced_config").([]interface{})
if len(userConfig) > 0 {
d.Set("advanced_config", advConfigList)
}
}

if obj.L2Extension != nil {
Expand Down

0 comments on commit 4e4b2bc

Please sign in to comment.