mirror of https://github.com/status-im/consul.git
consul: Handle API changes in StateStore
This commit is contained in:
parent
04818636e7
commit
98fffdacb5
|
@ -290,7 +290,7 @@ func TestFSM_DeregisterNode(t *testing.T) {
|
||||||
|
|
||||||
// Verify service not registered
|
// Verify service not registered
|
||||||
_, services := fsm.state.NodeServices("foo")
|
_, services := fsm.state.NodeServices("foo")
|
||||||
if len(services.Services) != 0 {
|
if services != nil {
|
||||||
t.Fatalf("Services: %v", services)
|
t.Fatalf("Services: %v", services)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,11 +174,13 @@ func (s *Server) handleAliveMember(member serf.Member) error {
|
||||||
if service != nil {
|
if service != nil {
|
||||||
match := false
|
match := false
|
||||||
_, services := state.NodeServices(member.Name)
|
_, services := state.NodeServices(member.Name)
|
||||||
|
if services != nil {
|
||||||
for id, _ := range services.Services {
|
for id, _ := range services.Services {
|
||||||
if id == service.ID {
|
if id == service.ID {
|
||||||
match = true
|
match = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if !match {
|
if !match {
|
||||||
goto AFTER_CHECK
|
goto AFTER_CHECK
|
||||||
}
|
}
|
||||||
|
|
|
@ -302,9 +302,8 @@ func TestDeleteNode(t *testing.T) {
|
||||||
if idx != 23 {
|
if idx != 23 {
|
||||||
t.Fatalf("bad: %v", idx)
|
t.Fatalf("bad: %v", idx)
|
||||||
}
|
}
|
||||||
_, ok := services.Services["api"]
|
if services != nil {
|
||||||
if ok {
|
t.Fatalf("has services: %#v", services)
|
||||||
t.Fatalf("has api: %#v", services)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
idx, checks := store.NodeChecks("foo")
|
idx, checks := store.NodeChecks("foo")
|
||||||
|
|
Loading…
Reference in New Issue