Stash client and server registration behind consul.auto_register

This commit is contained in:
Sean Chittenden 2016-06-10 01:05:55 -04:00
parent 68aebff84d
commit c92306f020
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16
1 changed files with 2 additions and 2 deletions

View File

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