MCPcopy
hub / github.com/kubevela/kubevela / prepareRun

Function prepareRun

cmd/core/app/server.go:239–267  ·  view source on GitHub ↗
(ctx context.Context, mgr manager.Manager, s *options.CoreOptions)

Source from the content-addressed store, hash-verified

237}
238
239func prepareRun(ctx context.Context, mgr manager.Manager, s *options.CoreOptions) error {
240 if s.UseWebhook {
241 klog.InfoS("Enable webhook", "server port", strconv.Itoa(s.WebhookPort))
242 oamwebhook.Register(mgr, *s.ControllerArgs)
243 if err := waitWebhookSecretVolume(s.CertDir, waitSecretTimeout, waitSecretInterval); err != nil {
244 klog.ErrorS(err, "Unable to get webhook secret")
245 return err
246 }
247 }
248
249 if err := oamv1beta1.Setup(mgr, *s.ControllerArgs); err != nil {
250 klog.ErrorS(err, "Unable to setup the oam controller")
251 return err
252 }
253
254 if err := multicluster.InitClusterInfo(mgr.GetConfig()); err != nil {
255 klog.ErrorS(err, "Init control plane cluster info")
256 return err
257 }
258
259 klog.Info("Start the vela controller manager")
260 for _, hook := range []hooks.PreStartHook{hooks.NewSystemCRDValidationHook()} {
261 if err := hook.Run(ctx); err != nil {
262 return fmt.Errorf("failed to run hook %T: %w", hook, err)
263 }
264 }
265
266 return nil
267}
268
269// registerHealthChecks is used to create readiness&liveness probes
270func registerHealthChecks(mgr ctrl.Manager) error {

Callers 2

runFunction · 0.85
prepareRunInShardingModeFunction · 0.85

Calls 7

InitClusterInfoFunction · 0.92
waitWebhookSecretVolumeFunction · 0.85
ErrorfMethod · 0.80
GetConfigMethod · 0.65
RunMethod · 0.65
InfoMethod · 0.45

Tested by

no test coverage detected