Skip to content

Commit 1d9eafd

Browse files
fix(olm): improve error logging for missing olm.managed label (#3558)
Previously, nonconforming CRDs (missing the label) were logged as INFO, but this caused the to enter a CrashLoopBackOff state due to unhandled inconsistencies. This commit raises the log level to and enhances the message with actionable advice, clarifying that users should either delete CRDs for uninstalled solutions or label them appropriately. The root cause of the scenario is: From an old release (ocp 4.15) the component managed by OLM should have the label olm.managed: true added to comply with the new checks.
1 parent eaef4e9 commit 1d9eafd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/controller/operators/labeller/filters.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"sync"
88

99
operators "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
10+
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install"
1011
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/reconciler"
1112
"github.com/sirupsen/logrus"
1213
"golang.org/x/sync/errgroup"
@@ -177,7 +178,11 @@ func Validate(ctx context.Context, logger *logrus.Logger, metadataClient metadat
177178
logger.WithFields(logrus.Fields{
178179
"gvr": gvr.String(),
179180
"nonconforming": count,
180-
}).Info("found nonconforming items")
181+
}).Errorf(
182+
"found nonconforming items: missing the the required label %q (metadata.labels[\"%s\"]=\"true\"). ",
183+
install.OLMManagedLabelKey,
184+
install.OLMManagedLabelKey,
185+
)
181186
}
182187
okLock.Lock()
183188
ok = ok && count == 0

0 commit comments

Comments
 (0)