diff --git a/command/agent/local.go b/command/agent/local.go index b35e86e847..8fa159c982 100644 --- a/command/agent/local.go +++ b/command/agent/local.go @@ -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 } diff --git a/command/agent/local_test.go b/command/agent/local_test.go index fb24477cad..6e289e593f 100644 --- a/command/agent/local_test.go +++ b/command/agent/local_test.go @@ -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