Pass listeners into setupSegments
This commit is contained in:
parent
5605d735a1
commit
ff994e9ade
|
@ -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
|
// setupSegments returns an error if any segments are defined since the OSS
|
||||||
// version of Consul doesn't support them.
|
// 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 {
|
if len(config.Segments) > 0 {
|
||||||
return structs.ErrSegmentsNotSupported
|
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
|
// Initialize the LAN segments before the default LAN Serf so we have
|
||||||
// updated port information to publish there.
|
// 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()
|
s.Shutdown()
|
||||||
return nil, fmt.Errorf("Failed to setup network segments: %v", err)
|
return nil, fmt.Errorf("Failed to setup network segments: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue