diff --git a/cmd/core/app/server.go b/cmd/core/app/server.go index 6515c0e21..59ccc58ee 100644 --- a/cmd/core/app/server.go +++ b/cmd/core/app/server.go @@ -201,6 +201,13 @@ func run(ctx context.Context, s *options.CoreOptions) error { } } + klog.Info("Start the vela application monitor") + informer, err := mgr.GetCache().GetInformer(ctx, &v1beta1.Application{}) + if err != nil { + klog.ErrorS(err, "Unable to get informer for application") + } + watcher.StartApplicationMetricsWatcher(informer) + if err := mgr.Start(ctx); err != nil { klog.ErrorS(err, "Failed to run manager") return err @@ -228,13 +235,6 @@ func prepareRunInShardingMode(ctx context.Context, mgr manager.Manager, s *optio } } - klog.Info("Start the vela application monitor") - informer, err := mgr.GetCache().GetInformer(ctx, &v1beta1.Application{}) - if err != nil { - klog.ErrorS(err, "Unable to get informer for application") - } - watcher.StartApplicationMetricsWatcher(informer) - return nil }