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 <[email protected]>
  • Loading branch information
awgreene committed Oct 9, 2023
1 parent 5a680ad commit a03580e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/operators/catalog/operator.go
Original file line number Diff line number Diff line change
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 a03580e

Please sign in to comment.