Merge pull request #537 from travisturner/grpc-port-0

Replace grpc port code that I removed for some reason
This commit is contained in:
Travis Turner 2020-07-10 11:06:40 -05:00 • committed by GitHub
commit c7ccd62b3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,6 +265,11 @@ func (m *Command) SetupServer() error {
return errors.Wrap(err, "creating grpc listener")
}
// If grpc port is 0, get auto-allocated port from listener
if grpcURI.Port == 0 {
grpcURI.SetPort(uint16(m.grpcLn.Addr().(*net.TCPAddr).Port))
}
// Setup TLS
if uri.Scheme == "https" {
m.tlsConfig, err = GetTLSConfig(&m.Config.TLS, m.logger.Logger())