mirror of https://github.com/hashicorp/consul
remove unused logger
parent
e4068befa2
commit
6e3c944e0e
|
@ -481,12 +481,7 @@ func (h *handlerAPIGateway) handleRouteConfigUpdate(ctx context.Context, u Updat
|
|||
cancelDiscoChain()
|
||||
delete(snap.APIGateway.WatchedDiscoveryChains, upstreamID)
|
||||
}
|
||||
reconcilePeeringWatches(snap.APIGateway.DiscoveryChain,
|
||||
snap.APIGateway.UpstreamConfig,
|
||||
snap.APIGateway.PeeredUpstreams,
|
||||
snap.APIGateway.PeerUpstreamEndpoints,
|
||||
snap.APIGateway.UpstreamPeerTrustBundles,
|
||||
h.logger)
|
||||
reconcilePeeringWatches(snap.APIGateway.DiscoveryChain, snap.APIGateway.UpstreamConfig, snap.APIGateway.PeeredUpstreams, snap.APIGateway.PeerUpstreamEndpoints, snap.APIGateway.UpstreamPeerTrustBundles)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -380,12 +380,7 @@ func (s *handlerConnectProxy) handleUpdate(ctx context.Context, u UpdateEvent, s
|
|||
//
|
||||
// Clean up data
|
||||
//
|
||||
reconcilePeeringWatches(snap.ConnectProxy.DiscoveryChain,
|
||||
snap.ConnectProxy.UpstreamConfig,
|
||||
snap.ConnectProxy.PeeredUpstreams,
|
||||
snap.ConnectProxy.PeerUpstreamEndpoints,
|
||||
snap.ConnectProxy.UpstreamPeerTrustBundles,
|
||||
s.logger)
|
||||
reconcilePeeringWatches(snap.ConnectProxy.DiscoveryChain, snap.ConnectProxy.UpstreamConfig, snap.ConnectProxy.PeeredUpstreams, snap.ConnectProxy.PeerUpstreamEndpoints, snap.ConnectProxy.UpstreamPeerTrustBundles)
|
||||
case u.CorrelationID == intentionUpstreamsID:
|
||||
resp, ok := u.Result.(*structs.IndexedServiceList)
|
||||
if !ok {
|
||||
|
@ -459,12 +454,7 @@ func (s *handlerConnectProxy) handleUpdate(ctx context.Context, u UpdateEvent, s
|
|||
delete(snap.ConnectProxy.WatchedUpstreams, uid)
|
||||
}
|
||||
}
|
||||
reconcilePeeringWatches(snap.ConnectProxy.DiscoveryChain,
|
||||
snap.ConnectProxy.UpstreamConfig,
|
||||
snap.ConnectProxy.PeeredUpstreams,
|
||||
snap.ConnectProxy.PeerUpstreamEndpoints,
|
||||
snap.ConnectProxy.UpstreamPeerTrustBundles,
|
||||
s.logger)
|
||||
reconcilePeeringWatches(snap.ConnectProxy.DiscoveryChain, snap.ConnectProxy.UpstreamConfig, snap.ConnectProxy.PeeredUpstreams, snap.ConnectProxy.PeerUpstreamEndpoints, snap.ConnectProxy.UpstreamPeerTrustBundles)
|
||||
for uid := range snap.ConnectProxy.WatchedUpstreamEndpoints {
|
||||
if upstream, ok := snap.ConnectProxy.UpstreamConfig[uid]; ok && !upstream.CentrallyConfigured {
|
||||
continue
|
||||
|
|
|
@ -177,12 +177,7 @@ func (s *handlerIngressGateway) handleUpdate(ctx context.Context, u UpdateEvent,
|
|||
delete(snap.IngressGateway.WatchedDiscoveryChains, uid)
|
||||
}
|
||||
}
|
||||
reconcilePeeringWatches(snap.IngressGateway.DiscoveryChain,
|
||||
snap.IngressGateway.UpstreamConfig,
|
||||
snap.IngressGateway.PeeredUpstreams,
|
||||
snap.IngressGateway.PeerUpstreamEndpoints,
|
||||
snap.IngressGateway.UpstreamPeerTrustBundles,
|
||||
s.logger)
|
||||
reconcilePeeringWatches(snap.IngressGateway.DiscoveryChain, snap.IngressGateway.UpstreamConfig, snap.IngressGateway.PeeredUpstreams, snap.IngressGateway.PeerUpstreamEndpoints, snap.IngressGateway.UpstreamPeerTrustBundles)
|
||||
|
||||
if err := s.watchIngressLeafCert(ctx, snap); err != nil {
|
||||
return err
|
||||
|
|
|
@ -555,13 +555,8 @@ func watchMeshGateway(ctx context.Context, opts gatewayWatchOpts) error {
|
|||
}, correlationId, opts.notifyCh)
|
||||
}
|
||||
|
||||
func reconcilePeeringWatches(
|
||||
compiledDiscoveryChains map[UpstreamID]*structs.CompiledDiscoveryChain,
|
||||
upstreams map[UpstreamID]*structs.Upstream,
|
||||
peeredUpstreams map[UpstreamID]struct{},
|
||||
peerUpstreamEndpoints watch.Map[UpstreamID, structs.CheckServiceNodes],
|
||||
upstreamPeerTrustBundles watch.Map[PeerName, *pbpeering.PeeringTrustBundle],
|
||||
logger hclog.Logger) {
|
||||
func reconcilePeeringWatches(compiledDiscoveryChains map[UpstreamID]*structs.CompiledDiscoveryChain, upstreams map[UpstreamID]*structs.Upstream, peeredUpstreams map[UpstreamID]struct{}, peerUpstreamEndpoints watch.Map[UpstreamID, structs.CheckServiceNodes], upstreamPeerTrustBundles watch.Map[PeerName, *pbpeering.PeeringTrustBundle]) {
|
||||
|
||||
peeredChainTargets := make(map[UpstreamID]struct{})
|
||||
for _, discoChain := range compiledDiscoveryChains {
|
||||
for _, target := range discoChain.Targets {
|
||||
|
|
|
@ -102,12 +102,7 @@ func (s *handlerUpstreams) handleUpdateUpstreams(ctx context.Context, u UpdateEv
|
|||
if err := s.resetWatchesFromChain(ctx, uid, resp.Chain, upstreamsSnapshot); err != nil {
|
||||
return err
|
||||
}
|
||||
reconcilePeeringWatches(upstreamsSnapshot.DiscoveryChain,
|
||||
upstreamsSnapshot.UpstreamConfig,
|
||||
upstreamsSnapshot.PeeredUpstreams,
|
||||
upstreamsSnapshot.PeerUpstreamEndpoints,
|
||||
upstreamsSnapshot.UpstreamPeerTrustBundles,
|
||||
s.logger)
|
||||
reconcilePeeringWatches(upstreamsSnapshot.DiscoveryChain, upstreamsSnapshot.UpstreamConfig, upstreamsSnapshot.PeeredUpstreams, upstreamsSnapshot.PeerUpstreamEndpoints, upstreamsSnapshot.UpstreamPeerTrustBundles)
|
||||
|
||||
case strings.HasPrefix(u.CorrelationID, upstreamPeerWatchIDPrefix):
|
||||
resp, ok := u.Result.(*structs.IndexedCheckServiceNodes)
|
||||
|
|
Loading…
Reference in New Issue