Skip to content

Commit

Permalink
Merge pull request #11663 from sbueringer/pr-fix-in-memory
Browse files Browse the repository at this point in the history
🐛 Fix periodic resync in in-memory provider
  • Loading branch information
k8s-ci-robot authored Jan 10, 2025
2 parents b6c3a96 + 575455d commit e89268d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -804,5 +804,5 @@ func (h *fakeHandler) OnDelete(resourceGroup string, obj client.Object) {
}

func (h *fakeHandler) OnGeneric(resourceGroup string, obj client.Object) {
h.events = append(h.events, fmt.Sprintf("%s, %s=%s, Synced", resourceGroup, obj.GetObjectKind().GroupVersionKind().Kind, obj.GetName()))
h.events = append(h.events, fmt.Sprintf("%s, %s=%s, Generic", resourceGroup, obj.GetObjectKind().GroupVersionKind().Kind, obj.GetName()))
}
2 changes: 1 addition & 1 deletion test/infrastructure/inmemory/pkg/runtime/cache/informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (c *cache) informSync(resourceGroup string, obj client.Object) {
defer i.lock.RUnlock()

for _, h := range i.handlers {
h.OnGeneric(resourceGroup, obj)
h.OnUpdate(resourceGroup, obj, obj)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func Test_cache_sync(t *testing.T) {
return false
}, 10*time.Second, 200*time.Millisecond).Should(BeTrue(), "object should be synced")

g.Expect(h.Events()).To(ContainElement("foo, CloudMachine=baz, Synced"))
g.Expect(h.Events()).To(ContainElement("foo, CloudMachine=baz, Updated"))

cancel()
}

0 comments on commit e89268d

Please sign in to comment.