diff --git a/agent/consul/leader_connect_ca.go b/agent/consul/leader_connect_ca.go index 75ac1df5d..51525f507 100644 --- a/agent/consul/leader_connect_ca.go +++ b/agent/consul/leader_connect_ca.go @@ -657,12 +657,10 @@ func (c *CAManager) secondaryInitializeIntermediateCA(provider ca.Provider, conf needsNewIntermediate = true } - newIntermediate := false if needsNewIntermediate { if err := c.secondaryRenewIntermediate(provider, newActiveRoot); err != nil { return err } - newIntermediate = true } else { // Discard the primary's representation since our local one is // sufficiently up to date. @@ -671,7 +669,7 @@ func (c *CAManager) secondaryInitializeIntermediateCA(provider ca.Provider, conf // Determine whether a root update is needed, and persist the roots/config accordingly. var newRoot *structs.CARoot - if activeRoot == nil || activeRoot.ID != newActiveRoot.ID || newIntermediate { + if activeRoot == nil || needsNewIntermediate { newRoot = newActiveRoot } if err := c.persistNewRootAndConfig(provider, newRoot, config); err != nil {