Skip to content

Commit

Permalink
connect: agent leaf cert caching improvements (#5091)
Browse files Browse the repository at this point in the history
* Add State storage and LastResult argument into Cache so that cache.Types can safely store additional data that is eventually expired.

* New Leaf cache type working and basic tests passing. TODO: more extensive testing for the Root change jitter across blocking requests, test concurrent fetches for different leaves interact nicely with rootsWatcher.

* Add multi-client and delayed rotation tests.

* Typos and cleanup error handling in roots watch

* Add comment about how the FetchResult can be used and change ca leaf state to use a non-pointer state.

* Plumb test override of root CA jitter through TestAgent so that tests are deterministic again!

* Fix failing config test
  • Loading branch information
banks authored Jan 10, 2019
1 parent 2dfc9ae commit 0638e09
Show file tree
Hide file tree
Showing 12 changed files with 990 additions and 348 deletions.
6 changes: 4 additions & 2 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -3419,8 +3419,10 @@ func (a *Agent) registerCache() {
})

a.cache.RegisterType(cachetype.ConnectCALeafName, &cachetype.ConnectCALeaf{
RPC: a,
Cache: a.cache,
RPC: a,
Cache: a.cache,
Datacenter: a.config.Datacenter,
TestOverrideCAChangeInitialDelay: a.config.ConnectTestCALeafRootChangeSpread,
}, &cache.RegisterOptions{
// Maintain a blocking query, retry dropped connections quickly
Refresh: true,
Expand Down
554 changes: 392 additions & 162 deletions agent/cache-types/connect_ca_leaf.go

Large diffs are not rendered by default.

Loading

0 comments on commit 0638e09

Please sign in to comment.