Skip to content

Commit 7a542e2

Browse files
committed
make mcp controller runnable
1 parent 7bae4c7 commit 7a542e2

File tree

1 file changed

+9
-0
lines changed
  • cmd/openmcp-operator/app

1 file changed

+9
-0
lines changed

cmd/openmcp-operator/app/run.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/openmcp-project/openmcp-operator/api/provider/v1alpha1"
2828
"github.com/openmcp-project/openmcp-operator/internal/config"
2929
"github.com/openmcp-project/openmcp-operator/internal/controllers/accessrequest"
30+
"github.com/openmcp-project/openmcp-operator/internal/controllers/managedcontrolplane"
3031
"github.com/openmcp-project/openmcp-operator/internal/controllers/provider"
3132
"github.com/openmcp-project/openmcp-operator/internal/controllers/scheduler"
3233
)
@@ -36,6 +37,7 @@ var allControllers = []string{
3637
strings.ToLower(scheduler.ControllerName),
3738
strings.ToLower(provider.ControllerName),
3839
strings.ToLower(accessrequest.ControllerName),
40+
strings.ToLower(managedcontrolplane.ControllerName),
3941
}
4042

4143
func NewRunCommand(so *SharedOptions) *cobra.Command {
@@ -302,6 +304,13 @@ func (o *RunOptions) Run(ctx context.Context) error {
302304
}
303305
}
304306

307+
// setup MCP controller
308+
if slices.Contains(o.Controllers, strings.ToLower(managedcontrolplane.ControllerName)) {
309+
if err := managedcontrolplane.NewManagedControlPlaneReconciler(o.Clusters.Platform, o.Clusters.Onboarding, mgr.GetEventRecorderFor(managedcontrolplane.ControllerName), o.Config.ManagedControlPlane).SetupWithManager(mgr); err != nil {
310+
return fmt.Errorf("unable to setup managedcontrolplane controller: %w", err)
311+
}
312+
}
313+
305314
// setup accessrequest controller
306315
if slices.Contains(o.Controllers, strings.ToLower(accessrequest.ControllerName)) {
307316
var arConfig *config.AccessRequestConfig

0 commit comments

Comments
 (0)