mirror of https://github.com/hashicorp/consul
streaming: disable streaming when requesting connect events
Until the correct events are created for terminating gateways.pull/9026/head
parent
c398a6b272
commit
bd44952c2e
|
@ -363,7 +363,13 @@ func New(bd BaseDeps) (*Agent, error) {
|
||||||
if bd.RuntimeConfig.UseStreamingBackend {
|
if bd.RuntimeConfig.UseStreamingBackend {
|
||||||
cacheName = cachetype.StreamingHealthServicesName
|
cacheName = cachetype.StreamingHealthServicesName
|
||||||
}
|
}
|
||||||
a.rpcClientHealth = &health.Client{Cache: bd.Cache, NetRPC: &a, CacheName: cacheName}
|
a.rpcClientHealth = &health.Client{
|
||||||
|
Cache: bd.Cache,
|
||||||
|
NetRPC: &a,
|
||||||
|
CacheName: cacheName,
|
||||||
|
// Temporarily until streaming supports all connect events
|
||||||
|
CacheNameConnect: cachetype.HealthServicesName,
|
||||||
|
}
|
||||||
|
|
||||||
a.serviceManager = NewServiceManager(&a)
|
a.serviceManager = NewServiceManager(&a)
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
NetRPC NetRPC
|
NetRPC NetRPC
|
||||||
Cache CacheGetter
|
Cache CacheGetter
|
||||||
|
// CacheName to use for service health.
|
||||||
CacheName string
|
CacheName string
|
||||||
|
// CacheNameConnect is the name of the cache to use for connect service health.
|
||||||
|
CacheNameConnect string
|
||||||
}
|
}
|
||||||
|
|
||||||
type NetRPC interface {
|
type NetRPC interface {
|
||||||
|
@ -51,7 +54,12 @@ func (c *Client) getServiceNodes(
|
||||||
return out, cache.ResultMeta{}, err
|
return out, cache.ResultMeta{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
raw, md, err := c.Cache.Get(ctx, c.CacheName, &req)
|
cacheName := c.CacheName
|
||||||
|
if req.Connect {
|
||||||
|
cacheName = c.CacheNameConnect
|
||||||
|
}
|
||||||
|
|
||||||
|
raw, md, err := c.Cache.Get(ctx, cacheName, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return out, md, err
|
return out, md, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue