From 047537833d69654356cc901ca885896cea9578d8 Mon Sep 17 00:00:00 2001 From: Dhia Ayachi Date: Mon, 12 Jul 2021 09:25:35 -0400 Subject: [PATCH] add missing state reset when stopping ca manager --- agent/consul/leader_connect_ca.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agent/consul/leader_connect_ca.go b/agent/consul/leader_connect_ca.go index 950ea35871..9bbf085912 100644 --- a/agent/consul/leader_connect_ca.go +++ b/agent/consul/leader_connect_ca.go @@ -278,8 +278,11 @@ func (c *CAManager) Stop() { needsStop.Stop() } } - c.setCAProvider(nil, nil) + c.setState(caStateUninitialized, false) + c.primaryRoots = structs.IndexedCARoots{} + c.actingSecondaryCA = false + c.setCAProvider(nil, nil) } func (c *CAManager) startPostInitializeRoutines(ctx context.Context) {