From 05347d16f0a75f6fc075558ca3480d527c1ee4af Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Fri, 10 Jan 2025 13:54:25 +0100 Subject: [PATCH] Fix resync in in-memory provider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- test/infrastructure/inmemory/pkg/runtime/cache/client_test.go | 2 +- test/infrastructure/inmemory/pkg/runtime/cache/informer.go | 2 +- test/infrastructure/inmemory/pkg/runtime/cache/sync_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/infrastructure/inmemory/pkg/runtime/cache/client_test.go b/test/infrastructure/inmemory/pkg/runtime/cache/client_test.go index 27fe91870933..2376098da95d 100644 --- a/test/infrastructure/inmemory/pkg/runtime/cache/client_test.go +++ b/test/infrastructure/inmemory/pkg/runtime/cache/client_test.go @@ -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())) } diff --git a/test/infrastructure/inmemory/pkg/runtime/cache/informer.go b/test/infrastructure/inmemory/pkg/runtime/cache/informer.go index 18fe4ddda93c..beba73571cc4 100644 --- a/test/infrastructure/inmemory/pkg/runtime/cache/informer.go +++ b/test/infrastructure/inmemory/pkg/runtime/cache/informer.go @@ -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) } } } diff --git a/test/infrastructure/inmemory/pkg/runtime/cache/sync_test.go b/test/infrastructure/inmemory/pkg/runtime/cache/sync_test.go index a3f3e7a4b2bf..e219af462821 100644 --- a/test/infrastructure/inmemory/pkg/runtime/cache/sync_test.go +++ b/test/infrastructure/inmemory/pkg/runtime/cache/sync_test.go @@ -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() }