Skip to content

Commit 9bcb201

Browse files
authored
Merge pull request #3689 from gman0/repl-vw-fix-list
Don't override RV when listing in Replication VW
2 parents d1a0bb8 + 69c35f2 commit 9bcb201

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

pkg/virtual/replication/builder/unwrap.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -331,17 +331,6 @@ func newUnwrappingWatch(
331331
Handler: clientgocache.ResourceEventHandlerDetailedFuncs{
332332
AddFunc: func(obj interface{}, isInInitialList bool) {
333333
cachedObj := tombstone.Obj[*cachev1alpha1.CachedObject](obj)
334-
if isInInitialList {
335-
if cachedObj.GetResourceVersion() <= innerListOpts.ResourceVersion {
336-
// This resource is older than the want we want to start from on isInInitial list replay.
337-
return
338-
}
339-
if innerListOpts.SendInitialEvents != nil && !*innerListOpts.SendInitialEvents {
340-
// The user explicitly requests not to send the initial list.
341-
return
342-
}
343-
}
344-
345334
innerObj, err := unwrapWithMatchingSelectors(cachedObj)
346335
if err != nil {
347336
w.safeWrite(watch.Event{
@@ -355,6 +344,17 @@ func newUnwrappingWatch(
355344
return
356345
}
357346

347+
if isInInitialList {
348+
if innerObj.GetResourceVersion() <= innerListOpts.ResourceVersion {
349+
// This resource is older than the one we want to start from on isInInitial list replay.
350+
return
351+
}
352+
if innerListOpts.SendInitialEvents != nil && !*innerListOpts.SendInitialEvents {
353+
// The user explicitly requests not to send the initial list.
354+
return
355+
}
356+
}
357+
358358
for _, cluster := range syntheticClusters() {
359359
obj := innerObj.DeepCopy()
360360
setCluster(obj, cluster)
@@ -499,7 +499,6 @@ func newUnwrappingList(innerListGVK schema.GroupVersionKind, innerObjGR schema.G
499499
continue
500500
}
501501

502-
innerObj.SetResourceVersion(item.GetResourceVersion())
503502
for _, cluster := range clusters {
504503
obj := innerObj.DeepCopy()
505504
setCluster(obj, cluster)

0 commit comments

Comments
 (0)