From be61bdc5b8dda2457ea551a4fa69ed049f848bb3 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Wed, 15 Jan 2014 17:28:23 -1000 Subject: [PATCH] Handle the serf check and consul service --- command/agent/local.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/command/agent/local.go b/command/agent/local.go index ff586a798e..ba56bb8045 100644 --- a/command/agent/local.go +++ b/command/agent/local.go @@ -1,6 +1,7 @@ package agent import ( + "github.com/hashicorp/consul/consul" "github.com/hashicorp/consul/consul/structs" "reflect" "sync" @@ -196,6 +197,11 @@ func (a *Agent) setSyncState() error { // If we don't have the service locally, deregister it existing, ok := a.state.services[id] if !ok { + // The Consul service is created automatically, and + // does not need to be registered + if id == consul.ConsulServiceID && a.config.Server { + continue + } a.state.serviceStatus[id] = syncStatus{remoteDelete: true} continue } @@ -210,6 +216,11 @@ func (a *Agent) setSyncState() error { id := check.CheckID existing, ok := a.state.checks[id] if !ok { + // The Serf check is created automatically, and does not + // need to be registered + if id == consul.SerfCheckID { + continue + } a.state.checkStatus[id] = syncStatus{remoteDelete: true} continue }