mirror of
https://github.com/status-im/consul.git
synced 2025-01-22 19:50:36 +00:00
Avoid storing chain without an upstream
This commit is contained in:
parent
ba12dc215b
commit
6af9a0d8cf
@ -43,6 +43,14 @@ func (s *handlerUpstreams) handleUpdateUpstreams(ctx context.Context, u cache.Up
|
|||||||
return fmt.Errorf("invalid type for response: %T", u.Result)
|
return fmt.Errorf("invalid type for response: %T", u.Result)
|
||||||
}
|
}
|
||||||
svc := strings.TrimPrefix(u.CorrelationID, "discovery-chain:")
|
svc := strings.TrimPrefix(u.CorrelationID, "discovery-chain:")
|
||||||
|
|
||||||
|
explicit := snap.ConnectProxy.UpstreamConfig[svc].HasLocalPortOrSocket()
|
||||||
|
if _, implicit := snap.ConnectProxy.IntentionUpstreams[svc]; !implicit && !explicit {
|
||||||
|
// Discovery chain is not associated with a known explicit or implicit upstream so it is skipped.
|
||||||
|
// The associated watch was likely cancelled.
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
upstreamsSnapshot.DiscoveryChain[svc] = resp.Chain
|
upstreamsSnapshot.DiscoveryChain[svc] = resp.Chain
|
||||||
|
|
||||||
if err := s.resetWatchesFromChain(ctx, svc, resp.Chain, upstreamsSnapshot); err != nil {
|
if err := s.resetWatchesFromChain(ctx, svc, resp.Chain, upstreamsSnapshot); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user