Skip to content

Commit 37d2ac6

Browse files
camilamacedo86openshift-cherrypick-robot
authored and
openshift-cherrypick-robot
committed
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. Upstream-repository: operator-lifecycle-manager Upstream-commit: 1d9eafd4278ec97ea4caa1b6d56d5f901d550374
1 parent 7788801 commit 37d2ac6

File tree

2 files changed

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

2 files changed

+12
-2
lines changed

staging/operator-lifecycle-manager/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

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

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

0 commit comments

Comments
 (0)