Skip to content

Commit 2fbaa7b

Browse files
awgreenetmshort
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]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 2625ded47cc8260b4a620fd45c2d440bb864413f
1 parent ecb5392 commit 2fbaa7b

File tree

2 files changed

+12
-0
lines changed
  • staging/operator-lifecycle-manager/pkg/controller/operators/catalog
  • vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog

2 files changed

+12
-0
lines changed

staging/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,12 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
11021102
return err
11031103
}
11041104

1105+
// If there are no subscriptions, don't attempt to sync the namespace.
1106+
if len(subs) == 0 {
1107+
logger.Debug(fmt.Sprintf("No subscriptions were found in namespace %v", namespace))
1108+
return nil
1109+
}
1110+
11051111
ogLister := o.lister.OperatorsV1().OperatorGroupLister().OperatorGroups(namespace)
11061112
failForwardEnabled, err := resolver.IsFailForwardEnabled(ogLister)
11071113
if err != nil {

vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)