Skip to content

Commit

Permalink
Fix error check for list operatorgroup call
Browse files Browse the repository at this point in the history
Signed-off-by: Vu Dinh <vudinh@outlook.com>
  • Loading branch information
dinhxuanvu committed Jul 9, 2021
1 parent a401647 commit 1d8e194
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/controller/operators/olm/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,10 @@ func (a *Operator) syncNamespace(obj interface{}) error {

// Query OG in this namespace
groups, err := a.lister.OperatorsV1().OperatorGroupLister().OperatorGroups(namespace.GetName()).List(labels.Everything())
if err != nil {
logger.WithError(err).Warn("failed to list OperatorGroups in the namespace")
return err
}

// Check if there is a stale multiple OG condition and clear it if existed.
if len(groups) == 1 {
Expand Down

0 comments on commit 1d8e194

Please sign in to comment.