agent: remove special case of consul service, adjust tests

This commit is contained in:
Ryan Uber 2014-10-15 14:49:10 -07:00
parent cd43b486a2
commit f83f80cf22
2 changed files with 4 additions and 8 deletions

View File

@ -314,11 +314,6 @@ func (l *localState) setSyncState() error {
// If we don't have the service locally, deregister it
existing, ok := l.services[id]
if !ok {
// The Consul service is created automatically, and
// does not need to be registered
if id == consul.ConsulServiceID && l.config.Server {
continue
}
l.serviceStatus[id] = syncStatus{remoteDelete: true}
continue
}
@ -339,6 +334,7 @@ func (l *localState) setSyncState() error {
if id == consul.SerfCheckID {
continue
}
l.checkStatus[id] = syncStatus{remoteDelete: true}
continue
}

View File

@ -42,7 +42,7 @@ func TestAgentAntiEntropy_Services(t *testing.T) {
srv2 := &structs.NodeService{
ID: "redis",
Service: "redis",
Tags: nil,
Tags: []string{},
Port: 8000,
}
agent.state.AddService(srv2)
@ -59,7 +59,7 @@ func TestAgentAntiEntropy_Services(t *testing.T) {
srv3 := &structs.NodeService{
ID: "web",
Service: "web",
Tags: nil,
Tags: []string{},
Port: 80,
}
agent.state.AddService(srv3)
@ -68,7 +68,7 @@ func TestAgentAntiEntropy_Services(t *testing.T) {
srv4 := &structs.NodeService{
ID: "lb",
Service: "lb",
Tags: nil,
Tags: []string{},
Port: 443,
}
args.Service = srv4