construction of GC should not fail for restmapper error caused by tpr
This commit is contained in:
@@ -50,7 +50,11 @@ func TestNewGarbageCollector(t *testing.T) {
|
||||
metaOnlyClientPool := dynamic.NewClientPool(config, api.Registry.RESTMapper(), dynamic.LegacyAPIPathResolverFunc)
|
||||
config.ContentConfig.NegotiatedSerializer = nil
|
||||
clientPool := dynamic.NewClientPool(config, api.Registry.RESTMapper(), dynamic.LegacyAPIPathResolverFunc)
|
||||
podResource := map[schema.GroupVersionResource]struct{}{schema.GroupVersionResource{Version: "v1", Resource: "pods"}: {}}
|
||||
podResource := map[schema.GroupVersionResource]struct{}{
|
||||
schema.GroupVersionResource{Version: "v1", Resource: "pods"}: {},
|
||||
// no monitor will be constructed for non-core resource, the GC construction will not fail.
|
||||
schema.GroupVersionResource{Group: "tpr.io", Version: "v1", Resource: "unknown"}: {},
|
||||
}
|
||||
gc, err := NewGarbageCollector(metaOnlyClientPool, clientPool, api.Registry.RESTMapper(), podResource)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
Reference in New Issue
Block a user