mirror of https://github.com/hashicorp/consul
agent: remove special case of consul service, adjust tests
parent
e2246b9f6c
commit
aa6ffc90f0
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue