Skip to content

Commit e89268d

Browse files
authored
Merge pull request #11663 from sbueringer/pr-fix-in-memory
🐛 Fix periodic resync in in-memory provider
2 parents b6c3a96 + 575455d commit e89268d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/infrastructure/inmemory/pkg/runtime/cache/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,5 +804,5 @@ func (h *fakeHandler) OnDelete(resourceGroup string, obj client.Object) {
804804
}
805805

806806
func (h *fakeHandler) OnGeneric(resourceGroup string, obj client.Object) {
807-
h.events = append(h.events, fmt.Sprintf("%s, %s=%s, Synced", resourceGroup, obj.GetObjectKind().GroupVersionKind().Kind, obj.GetName()))
807+
h.events = append(h.events, fmt.Sprintf("%s, %s=%s, Generic", resourceGroup, obj.GetObjectKind().GroupVersionKind().Kind, obj.GetName()))
808808
}

test/infrastructure/inmemory/pkg/runtime/cache/informer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (c *cache) informSync(resourceGroup string, obj client.Object) {
122122
defer i.lock.RUnlock()
123123

124124
for _, h := range i.handlers {
125-
h.OnGeneric(resourceGroup, obj)
125+
h.OnUpdate(resourceGroup, obj, obj)
126126
}
127127
}
128128
}

test/infrastructure/inmemory/pkg/runtime/cache/sync_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func Test_cache_sync(t *testing.T) {
7979
return false
8080
}, 10*time.Second, 200*time.Millisecond).Should(BeTrue(), "object should be synced")
8181

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

8484
cancel()
8585
}

0 commit comments

Comments
 (0)