Skip to content

Commit

Permalink
Don't sync namespaces that have no subscriptions
Browse files Browse the repository at this point in the history
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 <greene.al1991@gmail.com>
  • Loading branch information
awgreene authored and stevekuznetsov committed Oct 11, 2023
1 parent 5d0a2c2 commit 2625ded
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/operators/catalog/operator.go
Expand Up @@ -1152,6 +1152,12 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
return err
}

// If there are no subscriptions, don't attempt to sync the namespace.
if len(subs) == 0 {
logger.Debug(fmt.Sprintf("No subscriptions were found in namespace %v", namespace))
return nil
}

ogLister := o.lister.OperatorsV1().OperatorGroupLister().OperatorGroups(namespace)
failForwardEnabled, err := resolver.IsFailForwardEnabled(ogLister)
if err != nil {
Expand Down

0 comments on commit 2625ded

Please sign in to comment.