Pass listeners into setupSegments

This commit is contained in:
Kyle Havlovitz 2017-08-31 17:56:43 -07:00
parent 5605d735a1
commit ff994e9ade
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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)
}