construction of GC should not fail for restmapper error caused by tpr

This commit is contained in:
Chao Xu
2017-03-16 11:41:45 -07:00
parent 67a6c68d77
commit 33da82bc67
5 changed files with 55 additions and 25 deletions

View File

@@ -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)