From aa6ffc90f0626069f4b98254477ca16c703ab85a Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Wed, 15 Oct 2014 14:49:10 -0700 Subject: [PATCH] agent: remove special case of consul service, adjust tests --- command/agent/local.go | 6 +----- command/agent/local_test.go | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) 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