Skip to content

Commit

Permalink
Merge pull request #292 from terraform-providers/client_auth
Browse files Browse the repository at this point in the history
Fix client auth in policy resources
  • Loading branch information
annakhm authored Apr 20, 2020
2 parents 112eb6d + 56495e4 commit f9b307b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nsxt/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,9 @@ func configurePolicyConnectorData(d *schema.ResourceData, clients *nsxtClients)

httpClient := http.Client{Transport: tr}
clients.PolicyHTTPClient = &httpClient
clients.PolicySecurityContext = securityCtx
if securityContextNeeded {
clients.PolicySecurityContext = securityCtx
}
clients.Host = host

return nil
Expand All @@ -534,6 +536,8 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
func getPolicyConnector(clients interface{}) *client.RestConnector {
c := clients.(nsxtClients)
connector := client.NewRestConnector(c.Host, *c.PolicyHTTPClient)
connector.SetSecurityContext(c.PolicySecurityContext)
if c.PolicySecurityContext != nil {
connector.SetSecurityContext(c.PolicySecurityContext)
}
return connector
}

0 comments on commit f9b307b

Please sign in to comment.