mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 01:15:43 +03:00
Stash client and server registration behind consul.auto_register
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user