From 8be4ee766ab56cc2f14492a661361229661c9191 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Thu, 7 Sep 2017 16:37:11 -0700 Subject: [PATCH] Revert "Manages segments list via a pointer." This reverts commit c277a4250461443cbd63de0259e5e32766f651ea. --- agent/agent.go | 6 +++--- agent/consul/config.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 63ac00bcd..0c1483b95 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -783,10 +783,10 @@ func (a *Agent) consulConfig() (*consul.Config, error) { } // Setup the serf and memberlist config for any defined network segments. -func (a *Agent) segmentConfig() ([]*consul.NetworkSegment, error) { +func (a *Agent) segmentConfig() ([]consul.NetworkSegment, error) { + var segments []consul.NetworkSegment config := a.config - var segments []*consul.NetworkSegment for _, segment := range config.Segments { serfConf := consul.DefaultConfig().SerfLANConfig @@ -821,7 +821,7 @@ func (a *Agent) segmentConfig() ([]*consul.NetworkSegment, error) { } } - segments = append(segments, &consul.NetworkSegment{ + segments = append(segments, consul.NetworkSegment{ Name: segment.Name, Bind: serfConf.MemberlistConfig.BindAddr, Port: segment.Port, diff --git a/agent/consul/config.go b/agent/consul/config.go index 562c4e648..f01847310 100644 --- a/agent/consul/config.go +++ b/agent/consul/config.go @@ -122,7 +122,7 @@ type Config struct { // (Enterprise-only) Segments is a list of network segments for a server to // bind on. - Segments []*NetworkSegment + Segments []NetworkSegment // SerfLANConfig is the configuration for the intra-dc serf SerfLANConfig *serf.Config