@@ -150,7 +150,17 @@ func (h *clusterCache) OnSchemas(schemas *schema.Collection) error {
150150 opts := & client.Options {
151151 Schema : schema .Schema ,
152152 }
153- summaryInformer := informer .NewFilteredSummaryInformerWithOptions (h .summaryClient , gvr , opts , metav1 .NamespaceAll , 2 * time .Hour ,
153+ kubeconfigGVK := schema2.GroupVersionKind {Group : "ext.cattle.io" , Version : "v1" , Kind : "Kubeconfig" }
154+ tokenGVK := schema2.GroupVersionKind {Group : "ext.cattle.io" , Version : "v1" , Kind : "Token" }
155+ client := h .summaryClient
156+ // Due to a bug in Rancher's extension apiserver for the token and kubeconfig APIs, we
157+ // must disable the WatchList features for those APIs.
158+ if gvk == kubeconfigGVK || gvk == tokenGVK {
159+ client = & noWatchListClient {
160+ ExtendedInterface : h .summaryClient ,
161+ }
162+ }
163+ summaryInformer := informer .NewFilteredSummaryInformerWithOptions (client , gvr , opts , metav1 .NamespaceAll , 2 * time .Hour ,
154164 cache.Indexers {cache .NamespaceIndex : cache .MetaNamespaceIndexFunc }, nil )
155165 ctx , cancel := context .WithCancel (h .ctx )
156166 w := & watcher {
@@ -300,3 +310,12 @@ func callAll(handlers []interface{}, gvr schema2.GroupVersionKind, key string, o
300310
301311 return obj , merr .NewErrors (errs ... )
302312}
313+
314+ // noWatchListListWatch disables WatchList feature
315+ type noWatchListClient struct {
316+ client.ExtendedInterface
317+ }
318+
319+ func (n * noWatchListClient ) IsWatchListSemanticsUnSupported () bool {
320+ return true
321+ }
0 commit comments