Skip to content

Commit 76078eb

Browse files
committed
make mcp controller runnable
1 parent 49bd251 commit 76078eb

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 {
@@ -295,6 +297,13 @@ func (o *RunOptions) Run(ctx context.Context) error {
295297
}
296298
}
297299

300+
// setup MCP controller
301+
if slices.Contains(o.Controllers, strings.ToLower(managedcontrolplane.ControllerName)) {
302+
if err := managedcontrolplane.NewManagedControlPlaneReconciler(o.Clusters.Platform, o.Clusters.Onboarding, mgr.GetEventRecorderFor(managedcontrolplane.ControllerName), o.Config.ManagedControlPlane).SetupWithManager(mgr); err != nil {
303+
return fmt.Errorf("unable to setup managedcontrolplane controller: %w", err)
304+
}
305+
}
306+
298307
// setup accessrequest controller
299308
if slices.Contains(o.Controllers, strings.ToLower(accessrequest.ControllerName)) {
300309
var arConfig *config.AccessRequestConfig

0 commit comments

Comments
 (0)