Skip to content

Commit 9be239f

Browse files
committed
Register the console bits no matter in which namespace the operator runs
This is not working as well as we thought and it makes little sense in any case Tested locally with the pattern-operator in the openshift-operators namespace and the UI displayed correctly.
1 parent ecdb544 commit 9be239f

1 file changed

Lines changed: 12 additions & 19 deletions

File tree

cmd/main.go

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,19 @@ func main() {
105105

106106
registerComponentOrExit(mgr, argov1beta1api.AddToScheme)
107107

108-
// Register and enable the console plugin only when running in the
109-
// patterns-operator namespace. The legacy openshift-operators namespace
110-
// does not support the UI.
111-
if controllers.DetectOperatorNamespace() != controllers.LegacyOperatorNamespace {
112-
if err := mgr.Add(manager.RunnableFunc(func(ctx context.Context) error {
113-
if err := console.CreateOrUpdatePlugin(ctx, mgr.GetClient()); err != nil {
114-
setupLog.Error(err, "unable to create/update console plugin")
115-
}
116-
if err := console.EnablePlugin(ctx, mgr.GetClient()); err != nil {
117-
setupLog.Error(err, "unable to enable console plugin")
118-
}
119-
if err := console.CreateOrUpdateCatalog(ctx, mgr.GetClient(), mgr.GetAPIReader()); err != nil {
120-
setupLog.Error(err, "unable to create/update catalog deployment")
121-
}
122-
return nil
123-
})); err != nil {
124-
setupLog.Error(err, "unable to add console plugin runnable")
108+
if err := mgr.Add(manager.RunnableFunc(func(ctx context.Context) error {
109+
if err := console.CreateOrUpdatePlugin(ctx, mgr.GetClient()); err != nil {
110+
setupLog.Error(err, "unable to create/update console plugin")
125111
}
126-
} else {
127-
setupLog.Info("skipping console plugin registration in legacy namespace", "namespace", controllers.LegacyOperatorNamespace)
112+
if err := console.EnablePlugin(ctx, mgr.GetClient()); err != nil {
113+
setupLog.Error(err, "unable to enable console plugin")
114+
}
115+
if err := console.CreateOrUpdateCatalog(ctx, mgr.GetClient(), mgr.GetAPIReader()); err != nil {
116+
setupLog.Error(err, "unable to create/update catalog deployment")
117+
}
118+
return nil
119+
})); err != nil {
120+
setupLog.Error(err, "unable to add console plugin runnable")
128121
}
129122

130123
analyticsEnabled := areAnalyticsEnabled(mgr.GetAPIReader())

0 commit comments

Comments
 (0)