From 1e313e339c22d14836b9d1d317af335ad34b2f66 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Thu, 9 Mar 2017 09:25:42 -0800 Subject: [PATCH] Adds token to deregister request when reconciling. Fixes #2792. --- consul/leader.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/consul/leader.go b/consul/leader.go index 64e1671aa..65ceb2fb9 100644 --- a/consul/leader.go +++ b/consul/leader.go @@ -548,8 +548,9 @@ func (s *Server) handleDeregisterMember(reason string, member serf.Member) error // Deregister the node s.logger.Printf("[INFO] consul: member '%s' %s, deregistering", member.Name, reason) req := structs.DeregisterRequest{ - Datacenter: s.config.Datacenter, - Node: member.Name, + Datacenter: s.config.Datacenter, + Node: member.Name, + WriteRequest: structs.WriteRequest{Token: s.config.GetTokenForAgent()}, } var out struct{} return s.endpoints.Catalog.Deregister(&req, &out)