Skip to content

Commit c397876

Browse files
Wei WengWei Weng
authored andcommitted
simplify fake client
Signed-off-by: Wei Weng <Wei.Weng@microsoft.com>
1 parent d06eec8 commit c397876

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/utils/informer/manager.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,12 @@ func (m *FakeManager) GetNameSpaceScopedResources() []schema.GroupVersionResourc
163163
func (m *FakeManager) GetAllResources() []schema.GroupVersionResource {
164164
allResources := make([]schema.GroupVersionResource, 0, len(m.APIResources))
165165
for gvk := range m.APIResources {
166+
// Return a GVR with the same Group/Version and Kind as Resource
167+
// The actual resource name doesn't matter since IsInformerSynced ignores the GVR parameter
166168
gvr := schema.GroupVersionResource{
167169
Group: gvk.Group,
168170
Version: gvk.Version,
169-
Resource: gvk.Kind + "s", // Simple pluralization for tests
171+
Resource: gvk.Kind,
170172
}
171173
allResources = append(allResources, gvr)
172174
}

0 commit comments

Comments
 (0)