From 90124170e1f57448667428020a828c213b03b084 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sat, 27 Jan 2024 23:05:05 -0800 Subject: [PATCH] Start both auto and federated service monitor controller Signed-off-by: Tamal Saha --- pkg/apiserver/apiserver.go | 13 ++++--------- pkg/cmds/operator.go | 1 - 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index b49b4b018..4aa3351fa 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -201,24 +201,19 @@ func (c completedConfig) New(ctx context.Context) (*UIServer, error) { Group: monitoring.GroupName, Kind: monitoringv1.ServiceMonitorsKind, }, func(ctx context.Context, mgr ctrl.Manager) { - if err = servicemonitorcontroller.NewFederationReconciler( + if err = servicemonitorcontroller.NewAutoReconciler( c.ExtraConfig.ClientConfig, mgr.GetClient(), ).SetupWithManager(mgr); err != nil { - klog.Error(err, "unable to create controller", " federation controller", "ServiceMonitor") + klog.Error(err, "unable to create controller", "auto controller", "ServiceMonitor") os.Exit(1) } - }) - apiextensions.RegisterSetup(schema.GroupKind{ - Group: monitoring.GroupName, - Kind: monitoringv1.ServiceMonitorsKind, - }, func(ctx context.Context, mgr ctrl.Manager) { - if err = servicemonitorcontroller.NewAutoReconciler( + if err = servicemonitorcontroller.NewFederationReconciler( c.ExtraConfig.ClientConfig, mgr.GetClient(), ).SetupWithManager(mgr); err != nil { - klog.Error(err, "unable to create controller", "auto controller", "ServiceMonitor") + klog.Error(err, "unable to create controller", " federation controller", "ServiceMonitor") os.Exit(1) } }) diff --git a/pkg/cmds/operator.go b/pkg/cmds/operator.go index 7fb1e1bb0..cdb88f3c6 100644 --- a/pkg/cmds/operator.go +++ b/pkg/cmds/operator.go @@ -28,7 +28,6 @@ import ( ) func NewCmdOperator(ctx context.Context) *cobra.Command { - // o := server.NewOperatorOptions() o := server.NewOperatorOptions() cmd := &cobra.Command{