consul/agent/connect/ca
Connor 922619dfc3
Fix leaked Vault LifetimeRenewers (#12607)
* Fix leaked Vault LifetimeRenewers

When the Vault CA Provider is reconfigured we do not stop the
LifetimeRenewers which can cause them to leak until the Consul processes
recycles. On Configure execute stopWatcher if it exists and is not nil
before starting a new renewal

* Add jitter before restarting the LifetimeWatcher

If we fail to login to Vault or our token is no longer valid we can
overwhelm a Vault instance with many requests very quickly by restarting
the LifetimeWatcher. Before restarting the LifetimeWatcher provide a
backoff time of 1 second or less.

* Use a retry.Waiter instead of RandomStagger

* changelog

* gofmt'd

* Swap out bool for atomic.Unit32 in test

* Provide some extra clarification in comment and changelog
2022-03-28 09:58:16 -05:00
..
common.go ca: cleanup validateSetIntermediate 2022-02-17 18:21:30 -05:00
mock_Provider.go ca: update MockProvider for new interface 2022-01-27 12:51:35 -05:00
provider.go Update TODOs to reference an issue with more details 2022-02-17 18:21:30 -05:00
provider_aws.go ca/provider: remove ActiveRoot from Provider 2022-01-27 13:07:37 -05:00
provider_aws_test.go ca/provider: remove ActiveRoot from Provider 2022-01-27 13:07:37 -05:00
provider_consul.go ca: cleanup validateSetIntermediate 2022-02-17 18:21:30 -05:00
provider_consul_config.go add root_cert_ttl option for consul connect, vault ca providers (#11428) 2021-11-02 11:02:10 -07:00
provider_consul_test.go ca/provider: remove ActiveRoot from Provider 2022-01-27 13:07:37 -05:00
provider_test.go Vendor in rpc mono repo for net/rpc fork, go-msgpack, msgpackrpc. (#12311) 2022-02-14 09:45:45 -08:00
provider_vault.go Fix leaked Vault LifetimeRenewers (#12607) 2022-03-28 09:58:16 -05:00
provider_vault_test.go Fix leaked Vault LifetimeRenewers (#12607) 2022-03-28 09:58:16 -05:00
testing.go ca: require that tests that use Vault are named correctly 2022-02-28 16:13:53 -05:00