Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,19 @@ func main() {

registerComponentOrExit(mgr, argov1beta1api.AddToScheme)

// Register and enable the console plugin only when running in the
// patterns-operator namespace. The legacy openshift-operators namespace
// does not support the UI.
if controllers.DetectOperatorNamespace() != controllers.LegacyOperatorNamespace {
if err := mgr.Add(manager.RunnableFunc(func(ctx context.Context) error {
if err := console.CreateOrUpdatePlugin(ctx, mgr.GetClient()); err != nil {
setupLog.Error(err, "unable to create/update console plugin")
}
if err := console.EnablePlugin(ctx, mgr.GetClient()); err != nil {
setupLog.Error(err, "unable to enable console plugin")
}
if err := console.CreateOrUpdateCatalog(ctx, mgr.GetClient(), mgr.GetAPIReader()); err != nil {
setupLog.Error(err, "unable to create/update catalog deployment")
}
return nil
})); err != nil {
setupLog.Error(err, "unable to add console plugin runnable")
if err := mgr.Add(manager.RunnableFunc(func(ctx context.Context) error {
if err := console.CreateOrUpdatePlugin(ctx, mgr.GetClient()); err != nil {
setupLog.Error(err, "unable to create/update console plugin")
}
} else {
setupLog.Info("skipping console plugin registration in legacy namespace", "namespace", controllers.LegacyOperatorNamespace)
if err := console.EnablePlugin(ctx, mgr.GetClient()); err != nil {
setupLog.Error(err, "unable to enable console plugin")
}
if err := console.CreateOrUpdateCatalog(ctx, mgr.GetClient(), mgr.GetAPIReader()); err != nil {
setupLog.Error(err, "unable to create/update catalog deployment")
}
return nil
})); err != nil {
setupLog.Error(err, "unable to add console plugin runnable")
}

analyticsEnabled := areAnalyticsEnabled(mgr.GetAPIReader())
Expand Down