Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
  • Loading branch information
lukidzi committed May 29, 2024
1 parent 4725613 commit d2f7677
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
2 changes: 1 addition & 1 deletion pkg/kds/v2/server/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func New(
util_xds_v3.AdaptDeltaCallbacks(util_xds.LoggingCallbacks{Log: log}),
util_xds_v3.AdaptDeltaCallbacks(statsCallbacks),
// util_xds_v3.AdaptDeltaCallbacks(NewNackBackoff(nackBackoff)),
newKdsRetryForcer(log, reconciler.ForceVersion, nackBackoff, rt.EventBus()),
newKdsRetryForcer(log, reconciler.ForceVersion, nackBackoff, rt.EventBus(), hasher),
syncTracker,
status.DefaultStatusTracker(rt, log),
}
Expand Down
23 changes: 2 additions & 21 deletions pkg/kds/v2/server/resource_retry_forcer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

envoy_core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
envoy_sd "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
envoy_cache "github.com/envoyproxy/go-control-plane/pkg/cache/v3"
envoy_xds "github.com/envoyproxy/go-control-plane/pkg/server/v3"
"github.com/go-logr/logr"

Expand Down Expand Up @@ -45,21 +46,13 @@ import (
// We cannot simply invalidate existing snapshot because versions are also set in StreamState
type kdsRetryForcer struct {
util_xds_v3.NoopCallbacks
<<<<<<< HEAD
forceFn func(*envoy_core.Node, model.ResourceType)
log logr.Logger
nodes map[xds.StreamID]*envoy_core.Node
backoff time.Duration
emitter events.Emitter
=======
forceFn func(*envoy_core.Node, model.ResourceType)
log logr.Logger
nodes map[xds.StreamID]*envoy_core.Node
backoff time.Duration
emitter events.Emitter
hasher envoy_cache.NodeHash
streamToDelay map[xds.StreamID]bool
>>>>>>> cd189ee75 (fix(kds): fix the case when webhook/db reject resource (#10315))

sync.Mutex
}
Expand All @@ -69,23 +62,16 @@ func newKdsRetryForcer(
forceFn func(*envoy_core.Node, model.ResourceType),
backoff time.Duration,
emitter events.Emitter,
hasher envoy_cache.NodeHash,
) *kdsRetryForcer {
return &kdsRetryForcer{
<<<<<<< HEAD
forceFn: forceFn,
log: log,
nodes: map[xds.StreamID]*envoy_core.Node{},
backoff: backoff,
emitter: emitter,
=======
forceFn: forceFn,
log: log,
nodes: map[xds.StreamID]*envoy_core.Node{},
backoff: backoff,
emitter: emitter,
hasher: hasher,
streamToDelay: map[int64]bool{},
>>>>>>> cd189ee75 (fix(kds): fix the case when webhook/db reject resource (#10315))
}
}

Expand Down Expand Up @@ -117,12 +103,7 @@ func (r *kdsRetryForcer) OnStreamDeltaRequest(streamID xds.StreamID, request *en
r.streamToDelay[streamID] = true
}
r.Unlock()
<<<<<<< HEAD
r.log.Info("received NACK, will retry", "nodeID", node.Id, "type", request.TypeUrl, "err", request.GetErrorDetail().GetMessage(), "backoff", r.backoff)
time.Sleep(r.backoff)
=======
r.log.Info("received NACK, will retry", "nodeID", r.hasher.ID(request.Node), "type", request.TypeUrl, "err", request.GetErrorDetail().GetMessage(), "backoff", r.backoff)
>>>>>>> cd189ee75 (fix(kds): fix the case when webhook/db reject resource (#10315))
r.forceFn(node, model.ResourceType(request.TypeUrl))
r.emitter.Send(events.TriggerKDSResyncEvent{
Type: model.ResourceType(request.TypeUrl),
Expand Down

0 comments on commit d2f7677

Please sign in to comment.