@@ -127,6 +127,9 @@ func newOperatorWithConfig(ctx context.Context, config *operatorConfig) (*Operat
127
127
if err := k8sscheme .AddToScheme (scheme ); err != nil {
128
128
return nil , err
129
129
}
130
+ if err := metav1 .AddMetaToScheme (scheme ); err != nil {
131
+ return nil , err
132
+ }
130
133
131
134
op := & Operator {
132
135
Operator : queueOperator ,
@@ -208,8 +211,7 @@ func newOperatorWithConfig(ctx context.Context, config *operatorConfig) (*Operat
208
211
return nil , err
209
212
}
210
213
211
- // A separate informer solely for CSV copies. Fields
212
- // are pruned from local copies of the objects managed
214
+ // A separate informer solely for CSV copies. Object metadata requests are used
213
215
// by this informer in order to reduce cached size.
214
216
gvr := v1alpha1 .SchemeGroupVersion .WithResource ("clusterserviceversions" )
215
217
copiedCSVInformer := metadatainformer .NewFilteredMetadataInformer (
@@ -221,18 +223,18 @@ func newOperatorWithConfig(ctx context.Context, config *operatorConfig) (*Operat
221
223
func (options * metav1.ListOptions ) {
222
224
options .LabelSelector = v1alpha1 .CopiedLabelKey
223
225
},
224
- )
225
- op .copiedCSVLister = metadatalister .New (copiedCSVInformer .Informer (). GetIndexer (), gvr )
226
+ ). Informer ()
227
+ op .copiedCSVLister = metadatalister .New (copiedCSVInformer .GetIndexer (), gvr )
226
228
227
229
// Register separate queue for gcing copied csvs
228
230
copiedCSVGCQueue := workqueue .NewNamedRateLimitingQueue (workqueue .DefaultControllerRateLimiter (), fmt .Sprintf ("%s/csv-gc" , namespace ))
229
231
op .copiedCSVGCQueueSet .Set (namespace , copiedCSVGCQueue )
230
232
copiedCSVGCQueueInformer , err := queueinformer .NewQueueInformer (
231
233
ctx ,
232
- queueinformer .WithInformer (copiedCSVInformer . Informer () ),
234
+ queueinformer .WithInformer (copiedCSVInformer ),
233
235
queueinformer .WithLogger (op .logger ),
234
236
queueinformer .WithQueue (copiedCSVGCQueue ),
235
- queueinformer .WithIndexer (copiedCSVInformer .Informer (). GetIndexer ()),
237
+ queueinformer .WithIndexer (copiedCSVInformer .GetIndexer ()),
236
238
queueinformer .WithSyncer (queueinformer .LegacySyncHandler (op .syncGcCsv ).ToSyncer ()),
237
239
)
238
240
if err != nil {
0 commit comments