Skip to content

Commit 2625ded

Browse files
awgreenestevekuznetsov
authored andcommitted
Don't sync namespaces that have no subscriptions
Problem: The catalog operator is logging many errors regarding missing operator groups in namespaces that have no operators installed. Solution: If a namespace has no subscriptions in it, do not check if an operator group is present in the namespace. Signed-off-by: Alexander Greene <[email protected]>
1 parent 5d0a2c2 commit 2625ded

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/controller/operators/catalog/operator.go

+6
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,12 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
11521152
return err
11531153
}
11541154

1155+
// If there are no subscriptions, don't attempt to sync the namespace.
1156+
if len(subs) == 0 {
1157+
logger.Debug(fmt.Sprintf("No subscriptions were found in namespace %v", namespace))
1158+
return nil
1159+
}
1160+
11551161
ogLister := o.lister.OperatorsV1().OperatorGroupLister().OperatorGroups(namespace)
11561162
failForwardEnabled, err := resolver.IsFailForwardEnabled(ogLister)
11571163
if err != nil {

0 commit comments

Comments
 (0)