🚒 add error message in controller
This commit is contained in:
@@ -95,12 +95,10 @@ func NewJobController(jobInformer batchv1informers.JobInformer, client clientset
|
||||
}
|
||||
|
||||
func (v *JobController) Start(stopCh <-chan struct{}) error {
|
||||
v.Run(5, stopCh)
|
||||
|
||||
return nil
|
||||
return v.Run(5, stopCh)
|
||||
}
|
||||
|
||||
func (v *JobController) Run(workers int, stopCh <-chan struct{}) {
|
||||
func (v *JobController) Run(workers int, stopCh <-chan struct{}) error {
|
||||
defer utilruntime.HandleCrash()
|
||||
defer v.queue.ShutDown()
|
||||
|
||||
@@ -108,7 +106,7 @@ func (v *JobController) Run(workers int, stopCh <-chan struct{}) {
|
||||
defer log.Info("shutting down job controller")
|
||||
|
||||
if !cache.WaitForCacheSync(stopCh, v.jobSynced) {
|
||||
return
|
||||
return fmt.Errorf("failed to wait for caches to sync")
|
||||
}
|
||||
|
||||
for i := 0; i < workers; i++ {
|
||||
@@ -116,6 +114,7 @@ func (v *JobController) Run(workers int, stopCh <-chan struct{}) {
|
||||
}
|
||||
|
||||
<-stopCh
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *JobController) enqueueJob(obj interface{}) {
|
||||
|
||||
Reference in New Issue
Block a user