From 1a764553c028be1078373fb51e71c71c4e87802a Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 10 Nov 2020 18:38:09 -0500 Subject: [PATCH] rpcclient: use streaming for connect health --- agent/agent.go | 2 -- agent/consul/state/memdb.go | 6 ++---- agent/rpcclient/health/health.go | 9 +-------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 201dc7aee6..65d842fd43 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -377,8 +377,6 @@ func New(bd BaseDeps) (*Agent, error) { Cache: bd.Cache, NetRPC: &a, CacheName: cacheName, - // Temporarily until streaming supports all connect events - CacheNameConnect: cachetype.HealthServicesName, } a.serviceManager = NewServiceManager(&a) diff --git a/agent/consul/state/memdb.go b/agent/consul/state/memdb.go index 99c0f36bca..871e49581f 100644 --- a/agent/consul/state/memdb.go +++ b/agent/consul/state/memdb.go @@ -202,9 +202,7 @@ func processDBChanges(tx ReadTxn, changes Changes) ([]stream.Event, error) { func newSnapshotHandlers(db ReadDB) stream.SnapshotHandlers { return stream.SnapshotHandlers{ - topicServiceHealth: serviceHealthSnapshot(db, topicServiceHealth), - // The connect topic is temporarily disabled until the correct events are - // created for terminating gateway changes. - //topicServiceHealthConnect: serviceHealthSnapshot(db, topicServiceHealthConnect), + topicServiceHealth: serviceHealthSnapshot(db, topicServiceHealth), + topicServiceHealthConnect: serviceHealthSnapshot(db, topicServiceHealthConnect), } } diff --git a/agent/rpcclient/health/health.go b/agent/rpcclient/health/health.go index adc85e83cc..96b4fe6320 100644 --- a/agent/rpcclient/health/health.go +++ b/agent/rpcclient/health/health.go @@ -12,8 +12,6 @@ type Client struct { Cache CacheGetter // CacheName to use for service health. CacheName string - // CacheNameConnect is the name of the cache to use for connect service health. - CacheNameConnect string } type NetRPC interface { @@ -54,12 +52,7 @@ func (c *Client) getServiceNodes( return out, cache.ResultMeta{}, err } - cacheName := c.CacheName - if req.Connect { - cacheName = c.CacheNameConnect - } - - raw, md, err := c.Cache.Get(ctx, cacheName, &req) + raw, md, err := c.Cache.Get(ctx, c.CacheName, &req) if err != nil { return out, md, err }