Remove an unnecessary else
This commit is contained in:
parent
f6543b1651
commit
bcfb444a77
|
@ -658,14 +658,14 @@ func (a *Agent) listenAndServeGRPC() error {
|
|||
AuthCheckFrequency: xds.DefaultAuthCheckFrequency,
|
||||
}
|
||||
|
||||
var err error
|
||||
if a.config.HTTPSPort > 0 {
|
||||
// gRPC uses the same TLS settings as the HTTPS API. If HTTPS is
|
||||
// enabled then gRPC will require HTTPS as well.
|
||||
a.grpcServer, err = xdsServer.GRPCServer(a.tlsConfigurator)
|
||||
} else {
|
||||
a.grpcServer, err = xdsServer.GRPCServer(nil)
|
||||
tlsConfig := a.tlsConfigurator
|
||||
// gRPC uses the same TLS settings as the HTTPS API. If HTTPS is not enabled
|
||||
// then gRPC should not use TLS.
|
||||
if a.config.HTTPSPort <= 0 {
|
||||
tlsConfig = nil
|
||||
}
|
||||
var err error
|
||||
a.grpcServer, err = xdsServer.GRPCServer(tlsConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue