mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 06:16:08 +00:00
Purge chain if it shouldn't be there
This commit is contained in:
parent
fe85138453
commit
21f2c2e68d
@ -47,8 +47,9 @@ func (s *handlerUpstreams) handleUpdateUpstreams(ctx context.Context, u cache.Up
|
|||||||
switch snap.Kind {
|
switch snap.Kind {
|
||||||
case structs.ServiceKindIngressGateway:
|
case structs.ServiceKindIngressGateway:
|
||||||
if _, ok := snap.IngressGateway.UpstreamsSet[svc]; !ok {
|
if _, ok := snap.IngressGateway.UpstreamsSet[svc]; !ok {
|
||||||
// Discovery chain is not associated with a known explicit or implicit upstream so it is skipped.
|
// Discovery chain is not associated with a known explicit or implicit upstream so it is purged/skipped.
|
||||||
// The associated watch was likely cancelled.
|
// The associated watch was likely cancelled.
|
||||||
|
delete(upstreamsSnapshot.DiscoveryChain, svc)
|
||||||
s.logger.Trace("discovery-chain watch fired for unknown upstream", "upstream", svc)
|
s.logger.Trace("discovery-chain watch fired for unknown upstream", "upstream", svc)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -56,8 +57,9 @@ func (s *handlerUpstreams) handleUpdateUpstreams(ctx context.Context, u cache.Up
|
|||||||
case structs.ServiceKindConnectProxy:
|
case structs.ServiceKindConnectProxy:
|
||||||
explicit := snap.ConnectProxy.UpstreamConfig[svc].HasLocalPortOrSocket()
|
explicit := snap.ConnectProxy.UpstreamConfig[svc].HasLocalPortOrSocket()
|
||||||
if _, implicit := snap.ConnectProxy.IntentionUpstreams[svc]; !implicit && !explicit {
|
if _, implicit := snap.ConnectProxy.IntentionUpstreams[svc]; !implicit && !explicit {
|
||||||
// Discovery chain is not associated with a known explicit or implicit upstream so it is skipped.
|
// Discovery chain is not associated with a known explicit or implicit upstream so it is purged/skipped.
|
||||||
// The associated watch was likely cancelled.
|
// The associated watch was likely cancelled.
|
||||||
|
delete(upstreamsSnapshot.DiscoveryChain, svc)
|
||||||
s.logger.Trace("discovery-chain watch fired for unknown upstream", "upstream", svc)
|
s.logger.Trace("discovery-chain watch fired for unknown upstream", "upstream", svc)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user