mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 03:56:36 +00:00
Fix: recover application watcher when sharding disabled (#5488)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user