From 58adbea8ecd4b747da9afdae8f70cc6febb5058d Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Thu, 3 Aug 2023 08:30:31 -0600 Subject: [PATCH] operators/catalog: don't watch copied CSVs As far as I can tell, we never do anything with them. Signed-off-by: Steve Kuznetsov --- pkg/controller/operators/catalog/operator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/controller/operators/catalog/operator.go b/pkg/controller/operators/catalog/operator.go index 0d24b363d30..0daeddf4b5d 100644 --- a/pkg/controller/operators/catalog/operator.go +++ b/pkg/controller/operators/catalog/operator.go @@ -204,7 +204,9 @@ func NewOperator(ctx context.Context, kubeconfigPath string, clock utilclock.Clo // Fields are pruned from local copies of the objects managed // by this informer in order to reduce cached size. prunedCSVInformer := cache.NewSharedIndexInformer( - pruning.NewListerWatcher(op.client, metav1.NamespaceAll, func(*metav1.ListOptions) {}, pruning.PrunerFunc(func(csv *v1alpha1.ClusterServiceVersion) { + pruning.NewListerWatcher(op.client, metav1.NamespaceAll, func(options *metav1.ListOptions) { + options.LabelSelector = fmt.Sprintf("!%s", v1alpha1.CopiedLabelKey) + }, pruning.PrunerFunc(func(csv *v1alpha1.ClusterServiceVersion) { *csv = v1alpha1.ClusterServiceVersion{ TypeMeta: csv.TypeMeta, ObjectMeta: metav1.ObjectMeta{