Handle the serf check and consul service

This commit is contained in:
Armon Dadgar 2014-01-15 17:28:23 -10:00
parent 4ee8bde861
commit be61bdc5b8
1 changed files with 11 additions and 0 deletions

View File

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