Skip to content

Commit

Permalink
Merge pull request #4379 from hashicorp/b-consul-deregister
Browse files Browse the repository at this point in the history
Fix bug with determining when agent is a client
  • Loading branch information
dadgar committed Jun 6, 2018
2 parents f00e838 + 4d1cc8f commit 6122ebb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion command/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,11 @@ func (a *Agent) setupConsul(consulConfig *config.ConsulConfig) error {
a.consulCatalog = client.Catalog()

// Create Consul Service client for service advertisement and checks.
a.consulService = consul.NewServiceClient(client.Agent(), a.logger, a.Client() != nil)
isClient := false
if a.config.Client != nil && a.config.Client.Enabled {
isClient = true
}
a.consulService = consul.NewServiceClient(client.Agent(), a.logger, isClient)

// Run the Consul service client's sync'ing main loop
go a.consulService.Run()
Expand Down

0 comments on commit 6122ebb

Please sign in to comment.