From a423f07d63ff5d7263bd4e9ce70d494cddebbc0a Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Fri, 10 Jun 2016 01:05:55 -0400 Subject: [PATCH] Stash client and server registration behind consul.auto_register --- command/agent/agent.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/agent/agent.go b/command/agent/agent.go index e3548cc1d..bf50d93c0 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -367,7 +367,7 @@ func (a *Agent) setupServer() error { a.server = server // Create the Nomad Server services for Consul - if a.config.Consul.ServerServiceName != "" { + if a.config.Consul.AutoRegister && a.config.Consul.ServerServiceName != "" { const serviceGroupName = "server" a.consulSyncer.SetServices(serviceGroupName, []*structs.ConsulService{ &structs.ConsulService{ @@ -418,7 +418,7 @@ func (a *Agent) setupClient() error { a.client = client // Create the Nomad Server services for Consul - if a.config.Consul.ClientServiceName != "" { + if a.config.Consul.AutoRegister && a.config.Consul.ClientServiceName != "" { const serviceGroupName = "client" a.consulSyncer.SetServices(serviceGroupName, []*structs.ConsulService{ &structs.ConsulService{