mirror of
https://github.com/rancher/steve.git
synced 2025-09-18 00:08:17 +00:00
Add an attribute observedgeneration (#714)
* Add an attribute observedgeneration * add unit tests
This commit is contained in:
committed by
GitHub
parent
a020084518
commit
6946ffe8aa
@@ -52,7 +52,7 @@ type clusterCache struct {
|
||||
sync.RWMutex
|
||||
|
||||
ctx context.Context
|
||||
summaryClient client.Interface
|
||||
summaryClient client.ExtendedInterface
|
||||
watchers map[schema2.GroupVersionKind]*watcher
|
||||
workqueue workqueue.DelayingInterface
|
||||
|
||||
@@ -64,7 +64,7 @@ type clusterCache struct {
|
||||
func NewClusterCache(ctx context.Context, dynamicClient dynamic.Interface) ClusterCache {
|
||||
c := &clusterCache{
|
||||
ctx: ctx,
|
||||
summaryClient: client.NewForDynamicClient(dynamicClient),
|
||||
summaryClient: client.NewForExtendedDynamicClient(dynamicClient),
|
||||
watchers: map[schema2.GroupVersionKind]*watcher{},
|
||||
workqueue: workqueue.NewNamedDelayingQueue("cluster-cache"),
|
||||
}
|
||||
@@ -147,7 +147,10 @@ func (h *clusterCache) OnSchemas(schemas *schema.Collection) error {
|
||||
continue
|
||||
}
|
||||
|
||||
summaryInformer := informer.NewFilteredSummaryInformer(h.summaryClient, gvr, metav1.NamespaceAll, 2*time.Hour,
|
||||
opts := &client.Options{
|
||||
Schema: schema.Schema,
|
||||
}
|
||||
summaryInformer := informer.NewFilteredSummaryInformerWithOptions(h.summaryClient, gvr, opts, metav1.NamespaceAll, 2*time.Hour,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, nil)
|
||||
ctx, cancel := context.WithCancel(h.ctx)
|
||||
w := &watcher{
|
||||
|
Reference in New Issue
Block a user