func NewMetadataInformer()

in kubernetes/informer.go [315:334]


func NewMetadataInformer(client metadata.Interface, gvr schema.GroupVersionResource, opts WatchOptions, indexers cache.Indexers) cache.SharedInformer {
	ctx := context.Background()
	if indexers == nil {
		indexers = cache.Indexers{}
	}
	informer := cache.NewSharedIndexInformer(
		&cache.ListWatch{
			ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
				return client.Resource(gvr).List(ctx, options)
			},
			WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
				return client.Resource(gvr).Watch(ctx, options)
			},
		},
		&metav1.PartialObjectMetadata{},
		opts.SyncTimeout,
		indexers,
	)
	return informer
}