Skip to content

Commit

Permalink
Merge pull request #1 from terraform-providers/master
Browse files Browse the repository at this point in the history
Syncing to upstream
  • Loading branch information
madhukark authored Jun 4, 2020
2 parents 9b995d6 + f97b15f commit c21c478
Show file tree
Hide file tree
Showing 717 changed files with 32,934 additions and 94,615 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## 2.0.0 (Unreleased)
## 2.1.0 (Unreleased)
## 2.0.0 (March 30, 2020)

NOTES:

Expand Down Expand Up @@ -28,6 +29,8 @@ FEATURES:
* **New Data Source**: `nsxt_policy_lb_persistence_profile`
* **New Data Source**: `nsxt_policy_vni_pool`
* **New Data Source**: `nsxt_policy_realization_info`
* **New Data Source**: `nsxt_policy_segment_realization`
* **New Data Source**: `nsxt_firewall_section`

* **New Resource**: `nsxt_policy_tier0_gateway`
* **New Resource**: `nsxt_policy_tier1_gateway`
Expand All @@ -54,9 +57,17 @@ FEATURES:
* **New Resource**: `nsxt_policy_dhcp_relay`
* **New Resource**: `nsxt_policy_dhcp_server`

IMPROVEMENTS:
* Migrate to Terraform Plugin SDK ([#210](https://github.com/terraform-providers/terraform-provider-nsxt/pull/210))
* `resource/nsxt_vm_tags`: Avoid backend calls if no change required in corresponding tags ([#261](https://github.com/terraform-providers/terraform-provider-nsxt/pull/261))

BUG FIXES:
* Fix client authentication error that used to occur when client certificate is not self signed ([#207](https://github.com/terraform-providers/terraform-provider-nsxt/pull/207))
* Allow IPv6 in IP addresses and CIDR validations ([#204](https://github.com/terraform-providers/terraform-provider-nsxt/pull/204))
* `resource/nsxt_vm_tags`: Fix tag removal ([#240](https://github.com/terraform-providers/terraform-provider-nsxt/pull/240))
* `resource/nsxt_vm_tags`: Apply tags to all logical ports on given vm ([#235](https://github.com/terraform-providers/terraform-provider-nsxt/pull/235))
* `resource/nsxt_logical_dhcp_server`: Mark gateway_ip as optional rather than required ([#245](https://github.com/terraform-providers/terraform-provider-nsxt/pull/245))


## 1.1.2 (November 18, 2019)

Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ Documentation on the NSX platform can be found at the [NSX-T Documentation page]

# Using the Provider

The current version of this provider requires Terraform v0.10.2 or higher to
run.
The latest version of this provider requires Terraform v0.12 or higher to run.

The VMware supported version of the provider requires NSX version 2.2 onwards and Terraform 0.11.7. The recommended vSphere provider to be used in conjunction with the NSX-T Terraform Provider is 1.3.3 or above.
The VMware supported version of the provider requires NSX version 2.2 onwards and Terraform 0.12 onwards.
Version 2.0.0 of the provider offers NSX consumption via policy APIs, which is the recommended way.
Most policy resources are supported with NSX version 2.5 onwards, however some resources or attributes require NSX 3.0 onwards. Please refer to documentation for more details.
The recommended vSphere provider to be used in conjunction with the NSX-T Terraform Provider is 1.3.3 or above.

Note that you need to run `terraform init` to fetch the provider before
deploying. Read about the provider split and other changes to TF v0.10.0 in the
Expand Down Expand Up @@ -67,8 +69,8 @@ You can list versions of providers installed in your environment by running “t

```hcl
$ ./terraform version
Terraform v0.11.7
+ provider.nsxt v1.0.0
Terraform v0.12.7
+ provider.nsxt v2.0.0
+ provider.vsphere v1.5.0
```

Expand All @@ -78,10 +80,12 @@ Terraform v0.11.7
pre-release bugfix or feature, you will want to use the officially released
version of the provider (see [the section above](#using-the-provider)).

**NOTE:** Recommended way to compile the provider is using [Go Modules](https://blog.golang.org/using-go-modules), however vendored dependencies are still supported.

**NOTE:** Note that if the provider is manually copied to your running folder (rather than fetched with the “terraform init” based on provider block), Terraform is not aware of the version of the provider you’re running. It will appear as “unversioned”:
```hcl
$ ./terraform version
Terraform v0.11.1
Terraform v0.12.7
+ provider.nsxt (unversioned)
+ provider.vsphere v1.5.0
```
Expand Down Expand Up @@ -174,9 +178,12 @@ to run.

The following versions of NSX are supported:

* NSX-T 2.2.*
* NSX-T 2.3.*
* NSX-T 3.0
* NSX-T 2.5.*
* NSX-T 2.4.*
* NSX-T 2.3.*
* NSX-T 2.2.*


Some specific resources may require later versions of NSX-T.

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require (
github.com/hashicorp/go-version v1.2.0
github.com/hashicorp/terraform-plugin-sdk v1.1.0
github.com/vmware/go-vmware-nsxt v0.0.0-20191219213550-f4221331f638
github.com/vmware/vsphere-automation-sdk-go/lib v0.1.1
github.com/vmware/vsphere-automation-sdk-go/runtime v0.1.1
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.2.0
github.com/vmware/vsphere-automation-sdk-go/lib v0.2.0
github.com/vmware/vsphere-automation-sdk-go/runtime v0.2.0
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.3.0
)
17 changes: 17 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
Expand Down Expand Up @@ -172,15 +173,27 @@ github.com/vmware/go-vmware-nsxt v0.0.0-20191219213550-f4221331f638 h1:IhIA83a2W
github.com/vmware/go-vmware-nsxt v0.0.0-20191219213550-f4221331f638/go.mod h1:AzmozsuEImWQcg9Cfef9oMNoPQKcNaps6VkyJhzbSf0=
github.com/vmware/vsphere-automation-sdk-go/lib v0.1.1 h1:PmDaeuToX1QKKe9VWRJztAp2/IyjbbGZp6fEiff4Dr8=
github.com/vmware/vsphere-automation-sdk-go/lib v0.1.1/go.mod h1:BkjnHZykqeKKYDZEhyT4pxrEWprYqp4yC0xoCky6wjA=
github.com/vmware/vsphere-automation-sdk-go/lib v0.2.0 h1:noiASkafwxvCmmCtZK0f1pt06R8c+Fkt9TcZW7xpYy0=
github.com/vmware/vsphere-automation-sdk-go/lib v0.2.0/go.mod h1://FsAiCrr+T/Eq2Uxtq8UPVPbZWV7iLIvvXK17rsIxE=
github.com/vmware/vsphere-automation-sdk-go/runtime v0.1.1 h1:gsbyhqLBiYZQRs0EBPNijKkJNSGcvs1IlRmRi790o84=
github.com/vmware/vsphere-automation-sdk-go/runtime v0.1.1/go.mod h1:SRcvjNB5LycQEoeuwdwf9tSZ/glCmIBPfclZyk/+GLc=
github.com/vmware/vsphere-automation-sdk-go/runtime v0.2.0 h1:AM5AK9cyiJWFIfxrh1U/kuRFh+A2pymCEGiXqAkPzzw=
github.com/vmware/vsphere-automation-sdk-go/runtime v0.2.0/go.mod h1:M6pTKDrJrPlVG++lboLRf0bDYc3TJ2fsR+KOoWXfCns=
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.2.0 h1:pWAMR5S3jjJDF5DWeiIEB1c41F9+F/ga+EPmrTkFR+8=
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.2.0/go.mod h1:5zUcOhT4aCd6V3Xs6mqXVxVGHoKQ/zr1iwCvbSZtUfo=
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.3.0 h1:Ekf0/umhKdr4N0oURDFlkhZHVm6w0eXzbsn6yc/vL+4=
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.3.0/go.mod h1:k9tf91B5Ah7gkaM2s+Z6nATmn6gKmgt8AqJ8RUiKLfo=
github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty v1.1.0 h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw=
github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8=
github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0=
gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/lib v0.2.0 h1:+cZjFWuUvSjip24xfwvoZM7HfbDr+SaCO+Ivcy6QVO8=
gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/lib v0.2.0/go.mod h1:5XGjWzhK3FzCvd8UF2XJehkTou62buyRaprG78iyuPo=
gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/runtime v0.2.0 h1:PwLzRMlDmJ8W+/97TEueoqR31f266Z8CfhFjHXdPqlM=
gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/runtime v0.2.0/go.mod h1:QMfGHVgLbJkmt1F1bBajXXX5y1GTRY03XC0tLwfuYHo=
gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/services/nsxt v0.3.0 h1:9SI8iPVTtqS+Q076P5RE4G+QXV8gem2p9f9L8CFp8So=
gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/services/nsxt v0.3.0/go.mod h1:04MIIof1zW95zy0e2mTFRKoUubFx8ztCJVPPrKd2cXQ=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
Expand Down Expand Up @@ -214,6 +227,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa h1:F+8P+gmewFQYRk6JoLQLwjBCTu3mcIURZfNkVweuRKA=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
Expand All @@ -236,6 +251,8 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_ip_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func dataSourceNsxtIPPoolRead(d *schema.ResourceData, m interface{}) error {
}
}
if !found {
return fmt.Errorf("IP pool '%s' was not found out of %d services", objName, len(objList.Results))
return fmt.Errorf("IP pool '%s' was not found out of %d objects", objName, len(objList.Results))
}
} else {
return fmt.Errorf("Error obtaining IP pool ID or name during read")
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_edge_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func dataSourceNsxtPolicyEdgeClusterRead(d *schema.ResourceData, m interface{})
var obj model.PolicyEdgeCluster
if objID != "" {
// Get by id
objGet, err := client.Get(defaultSite, policyEnforcementPoint, objID)
objGet, err := client.Get(defaultSite, getPolicyEnforcementPoint(m), objID)

if err != nil {
return handleDataSourceReadError(d, "Edge Cluster", objID, err)
Expand All @@ -45,7 +45,7 @@ func dataSourceNsxtPolicyEdgeClusterRead(d *schema.ResourceData, m interface{})
} else {
// Get by full name/prefix
includeMarkForDeleteObjectsParam := false
objList, err := client.List(defaultSite, policyEnforcementPoint, nil, &includeMarkForDeleteObjectsParam, nil, nil, nil, nil)
objList, err := client.List(defaultSite, getPolicyEnforcementPoint(m), nil, &includeMarkForDeleteObjectsParam, nil, nil, nil, nil)
if err != nil {
return handleListError("Edge Cluster", err)
}
Expand Down
8 changes: 4 additions & 4 deletions nsxt/data_source_nsxt_policy_edge_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ func dataSourceNsxtPolicyEdgeNodeRead(d *schema.ResourceData, m interface{}) err
edgeClusterPath := d.Get("edge_cluster_path").(string)
edgeClusterID := getPolicyIDFromPath(edgeClusterPath)
objID := d.Get("id").(string)
name, nameSet := d.GetOkExists("display_name")
name, nameSet := d.GetOk("display_name")
objName := name.(string)
memberIndex, memberIndexSet := d.GetOkExists("member_index")
memberIndex, memberIndexSet := d.GetOk("member_index")
objMemberIndex := int64(memberIndex.(int))
var obj model.PolicyEdgeNode
if objID != "" {
// Get by id
objGet, err := client.Get(defaultSite, policyEnforcementPoint, edgeClusterID, objID)
objGet, err := client.Get(defaultSite, getPolicyEnforcementPoint(m), edgeClusterID, objID)

if err != nil {
return handleDataSourceReadError(d, "Edge Node", objID, err)
Expand All @@ -56,7 +56,7 @@ func dataSourceNsxtPolicyEdgeNodeRead(d *schema.ResourceData, m interface{}) err
} else {
// Get by full name/prefix
includeMarkForDeleteObjectsParam := false
objList, err := client.List(defaultSite, policyEnforcementPoint, edgeClusterID, nil, &includeMarkForDeleteObjectsParam, nil, nil, nil, nil)
objList, err := client.List(defaultSite, getPolicyEnforcementPoint(m), edgeClusterID, nil, &includeMarkForDeleteObjectsParam, nil, nil, nil, nil)
if err != nil {
return handleListError("Edge Node", err)
}
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func testAccDataSourceNsxtPolicyGatewayQosProfileCreate(name string) error {
// Generate a random ID for the resource
id := newUUID()

err = client.Patch(id, obj, nil)
err = client.Patch(id, obj)
if err != nil {
return handleCreateError("GatewayQosProfile", id, err)
}
Expand All @@ -81,7 +81,7 @@ func testAccDataSourceNsxtPolicyGatewayQosProfileDeleteByName(name string) error
}
for _, objInList := range objList.Results {
if *objInList.DisplayName == name {
err := client.Delete(*objInList.Id, nil)
err := client.Delete(*objInList.Id)
if err != nil {
return handleDeleteError("GatewayQosProfile", *objInList.Id, err)
}
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_ip_block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func testAccDataSourceNsxtPolicyIPBlockCreate(name string) error {
obj := model.IpAddressBlock{
Description: &description,
DisplayName: &displayName,
Cidr: cidr,
Cidr: &cidr,
}

// Generate a random ID for the resource
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func testAccDataSourceNsxtPolicyIPDiscoveryProfileCreate(name string) error {
// Generate a random ID for the resource
id := newUUID()

err = client.Patch(id, obj, nil)
err = client.Patch(id, obj)
if err != nil {
return handleCreateError("IPDiscoveryProfile", id, err)
}
Expand All @@ -81,7 +81,7 @@ func testAccDataSourceNsxtPolicyIPDiscoveryProfileDeleteByName(name string) erro
}
for _, objInList := range objList.Results {
if *objInList.DisplayName == name {
err := client.Delete(*objInList.Id, nil)
err := client.Delete(*objInList.Id)
if err != nil {
return handleDeleteError("IPDiscoveryProfile", *objInList.Id, err)
}
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func testAccDataSourceNsxtPolicyIpv6DadProfileCreate(name string) error {
// Generate a random ID for the resource
id := newUUID()

err = client.Patch(id, obj, nil)
err = client.Patch(id, obj)
if err != nil {
return handleCreateError("Ipv6DadProfile", id, err)
}
Expand All @@ -81,7 +81,7 @@ func testAccDataSourceNsxtPolicyIpv6DadProfileDeleteByName(name string) error {
}
for _, objInList := range objList.Results {
if *objInList.DisplayName == name {
err := client.Delete(*objInList.Id, nil)
err := client.Delete(*objInList.Id)
if err != nil {
return handleDeleteError("Ipv6DadProfile", *objInList.Id, err)
}
Expand Down
9 changes: 6 additions & 3 deletions nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,19 @@ func testAccDataSourceNsxtPolicyIpv6NdraProfileCreate(name string) error {

displayName := name
description := name
mode := model.Ipv6NdraProfile_RA_MODE_DISABLED
config := model.RAConfig{}
obj := model.Ipv6NdraProfile{
Description: &description,
DisplayName: &displayName,
RaMode: model.Ipv6NdraProfile_RA_MODE_DISABLED,
RaMode: &mode,
RaConfig: &config,
}

// Generate a random ID for the resource
id := newUUID()

err = client.Patch(id, obj, nil)
err = client.Patch(id, obj)
if err != nil {
return handleCreateError("Ipv6NdraProfile", id, err)
}
Expand All @@ -82,7 +85,7 @@ func testAccDataSourceNsxtPolicyIpv6NdraProfileDeleteByName(name string) error {
}
for _, objInList := range objList.Results {
if *objInList.DisplayName == name {
err := client.Delete(*objInList.Id, nil)
err := client.Delete(*objInList.Id)
if err != nil {
return fmt.Errorf("Error during Ipv6NdraProfile deletion: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_lb_app_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func dataSourceNsxtPolicyLBAppProfileRead(d *schema.ResourceData, m interface{})
client := infra.NewDefaultLbAppProfilesClient(connector)

objID := d.Get("id").(string)
objTypeValue, typeSet := d.GetOkExists("type")
objTypeValue, typeSet := d.GetOk("type")
objType := objTypeValue.(string)
objName := d.Get("display_name").(string)
var result *model.LBAppProfile
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_lb_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func dataSourceNsxtPolicyLBMonitorRead(d *schema.ResourceData, m interface{}) er
client := infra.NewDefaultLbMonitorProfilesClient(connector)

objID := d.Get("id").(string)
objTypeValue, typeSet := d.GetOkExists("type")
objTypeValue, typeSet := d.GetOk("type")
objType := objTypeValue.(string)
objName := d.Get("display_name").(string)
var result *model.LBMonitorProfile
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_lb_persistence_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func dataSourceNsxtPolicyLbPersistenceProfileRead(d *schema.ResourceData, m inte

objID := d.Get("id").(string)
objName := d.Get("display_name").(string)
objTypeValue, typeSet := d.GetOkExists("type")
objTypeValue, typeSet := d.GetOk("type")
objType := objTypeValue.(string)

var obj model.PolicyLbPersistenceProfile
Expand Down
5 changes: 3 additions & 2 deletions nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ func testAccDataSourceNsxtPolicyMacDiscoveryProfileCreate(name string) error {
obj := model.MacDiscoveryProfile{
Description: &description,
DisplayName: &displayName,
MacLearningEnabled: &boolFalse,
UnknownUnicastFloodingEnabled: &boolFalse,
}

// Generate a random ID for the resource
id := newUUID()

err = client.Patch(id, obj, nil)
err = client.Patch(id, obj)
if err != nil {
return handleCreateError("MacDiscoveryProfile", id, err)
}
Expand All @@ -83,7 +84,7 @@ func testAccDataSourceNsxtPolicyMacDiscoveryProfileDeleteByName(name string) err
}
for _, objInList := range objList.Results {
if *objInList.DisplayName == name {
err := client.Delete(*objInList.Id, nil)
err := client.Delete(*objInList.Id)
if err != nil {
return fmt.Errorf("Error during MacDiscoveryProfile deletion: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_qos_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func testAccDataSourceNsxtPolicyQosProfileCreate(name string) error {
// Generate a random ID for the resource
id := newUUID()

err = client.Patch(id, obj, nil)
err = client.Patch(id, obj)
if err != nil {
return handleCreateError("QosProfile", id, err)
}
Expand All @@ -81,7 +81,7 @@ func testAccDataSourceNsxtPolicyQosProfileDeleteByName(name string) error {
}
for _, objInList := range objList.Results {
if *objInList.DisplayName == name {
err := client.Delete(*objInList.Id, nil)
err := client.Delete(*objInList.Id)
if err != nil {
return handleDeleteError("QosProfile", *objInList.Id, err)
}
Expand Down
Loading

0 comments on commit c21c478

Please sign in to comment.