Browse Source

Avoid storing chain without an upstream

pull/11826/head
freddygv 3 years ago
parent
commit
6af9a0d8cf
  1. 8
      agent/proxycfg/upstreams.go

8
agent/proxycfg/upstreams.go

@ -43,6 +43,14 @@ func (s *handlerUpstreams) handleUpdateUpstreams(ctx context.Context, u cache.Up
return fmt.Errorf("invalid type for response: %T", u.Result)
}
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
if err := s.resetWatchesFromChain(ctx, svc, resp.Chain, upstreamsSnapshot); err != nil {

Loading…
Cancel
Save