func StartControllers(ctx context.Context, controllerCtx ControllerContext, controllers map[string]InitFunc, unsecuredMux *mux.PathRecorderMux) error {
	for controllerName, initFn := range controllers {
		if !controllerCtx.IsControllerEnabled(controllerName) {
			klog.Warningf("%q is disabled", controllerName)
			continue
		}

		time.Sleep(wait.Jitter(controllerCtx.ControllerStartInterval.Duration, ControllerStartJitter))

		klog.V(1).Infof("Starting %q", controllerName)
		debugHandler, started, err := initFn(ctx, controllerCtx)
		if err != nil {
			klog.Errorf("Error starting %q", controllerName)
			return err
		}
		if !started {
			klog.Warningf("Skipping %q", controllerName)
			continue
		}
		if debugHandler != nil && unsecuredMux != nil {
			basePath := "/debug/controllers/" + controllerName
			unsecuredMux.UnlistedHandle(basePath, http.StripPrefix(basePath, debugHandler))
			unsecuredMux.UnlistedHandlePrefix(basePath+"/", http.StripPrefix(basePath, debugHandler))
		}
		klog.Infof("Started %q", controllerName)
	}

	return nil
}
// StartControllers to start the controller.
StartControllers to start the controller.
// StartControllers to start the controller .
func StartControllers(ctx context.Context, controllerCtx ControllerContext, controllers map[string]InitFunc, unsecuredMux *mux.PathRecorderMux) error {
	for controllerName, initFn := range controllers {
		if !controllerCtx.IsControllerEnabled(controllerName) {
			klog.Warningf("%q is disabled", controllerName)
			continue
		}
		time.Sleep(wait.Jitter(controllerCtx.ControllerStartInterval.Duration, ControllerStartJitter))
		klog.V(1).Infof("Starting %q", controllerName)
		debugHandler, started, err := initFn(ctx, controllerCtx)
		if err != nil {
			klog.Errorf("Error starting %q", controllerName)
			return err
		}
		if !started {
			klog.Warningf("Skipping %q", controllerName)
			continue
		}
		if debugHandler != nil && unsecuredMux != nil {
			basePath := "/debug/controllers/" + controllerName
			unsecuredMux.UnlistedHandle(basePath, http.StripPrefix(basePath, debugHandler))
			unsecuredMux.UnlistedHandlePrefix(basePath+"/", http.StripPrefix(basePath, debugHandler))
		}
		klog.Infof("Started %q", controllerName)
	}
	return nil
}
func StartControllers ( ctx context . Context , controllerCtx ControllerContext , controllers map [ string ] InitFunc , unsecuredMux * mux . PathRecorderMux ) error { for controllerName , initFn := range controllers { if ! controllerCtx . IsControllerEnabled ( controllerName ) { klog . Warningf ( " " , controllerName ) continue } time . Sleep ( wait . Jitter ( controllerCtx . ControllerStartInterval . Duration , ControllerStartJitter ) ) klog . V ( 1 ) . Infof ( " " , controllerName ) debugHandler , started , err := initFn ( ctx , controllerCtx ) if err != nil { klog . Errorf ( " " , controllerName ) return err } if ! started { klog . Warningf ( " " , controllerName ) continue } if debugHandler != nil && unsecuredMux != nil { basePath := " " + controllerName unsecuredMux . UnlistedHandle ( basePath , http . StripPrefix ( basePath , debugHandler ) ) unsecuredMux . UnlistedHandlePrefix ( basePath + " " , http . StripPrefix ( basePath , debugHandler ) ) } klog . Infof ( " " , controllerName ) } return nil }
StartControllers to start the controller.
StartControllers to start the controller .