From 1d8e194bb40d70d97ee6e4c0844e21bd39ba4396 Mon Sep 17 00:00:00 2001 From: Vu Dinh Date: Fri, 9 Jul 2021 17:09:17 -0400 Subject: [PATCH] Fix error check for list operatorgroup call Signed-off-by: Vu Dinh --- pkg/controller/operators/olm/operator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller/operators/olm/operator.go b/pkg/controller/operators/olm/operator.go index 40afd43f90..5242fd4b48 100644 --- a/pkg/controller/operators/olm/operator.go +++ b/pkg/controller/operators/olm/operator.go @@ -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 {