Simplify OPA to use rootCAs custom transport (#6843)

Also close the connections properly to use the
connection pooling properly for HTTP clients.
This commit is contained in:
Harshavardhana
2018-11-21 19:01:05 -08:00
committed by Nitish Tiwari
parent 2fc024e880
commit d4265f9a13
2 changed files with 15 additions and 49 deletions

View File

@@ -556,8 +556,10 @@ func (s *serverConfig) loadToCachedConfigs() {
if globalPolicyOPA == nil {
if s.Policy.OPA.URL != nil && s.Policy.OPA.URL.String() != "" {
globalPolicyOPA = iampolicy.NewOpa(iampolicy.OpaArgs{
URL: s.Policy.OPA.URL,
AuthToken: s.Policy.OPA.AuthToken,
URL: s.Policy.OPA.URL,
AuthToken: s.Policy.OPA.AuthToken,
Transport: NewCustomHTTPTransport(),
CloseRespFn: CloseResponse,
})
}
}