Skip to content

Commit

Permalink
Fix resync in in-memory provider
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer [email protected]
  • Loading branch information
sbueringer committed Jan 10, 2025
1 parent 7f2a8cd commit 575455d
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 575455d

Please sign in to comment.