mirror of https://github.com/status-im/consul.git
Pass listeners into setupSegments
This commit is contained in:
parent
40f7508016
commit
0e33e2ecab
|
@ -35,7 +35,7 @@ func (s *Server) setupSegmentRPC() (map[string]net.Listener, error) {
|
|||
|
||||
// setupSegments returns an error if any segments are defined since the OSS
|
||||
// version of Consul doesn't support them.
|
||||
func (s *Server) setupSegments(config *Config, port int) error {
|
||||
func (s *Server) setupSegments(config *Config, port int, rpcListeners map[string]net.Listener) error {
|
||||
if len(config.Segments) > 0 {
|
||||
return structs.ErrSegmentsNotSupported
|
||||
}
|
||||
|
|
|
@ -381,7 +381,7 @@ func NewServerLogger(config *Config, logger *log.Logger, tokens *token.Store) (*
|
|||
|
||||
// Initialize the LAN segments before the default LAN Serf so we have
|
||||
// updated port information to publish there.
|
||||
if err := s.setupSegments(config, serfBindPortWAN); err != nil {
|
||||
if err := s.setupSegments(config, serfBindPortWAN, segmentListeners); err != nil {
|
||||
s.Shutdown()
|
||||
return nil, fmt.Errorf("Failed to setup network segments: %v", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue