File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -119,20 +119,18 @@ func (jm *Controller) syncAll() {
119
119
js = append (js , * jobTmp )
120
120
return nil
121
121
})
122
-
123
122
if err != nil {
124
123
utilruntime .HandleError (fmt .Errorf ("Failed to extract job list: %v" , err ))
125
124
return
126
125
}
127
-
128
126
klog .V (4 ).Infof ("Found %d jobs" , len (js ))
129
- cronJobListFunc := func (opts metav1.ListOptions ) (runtime.Object , error ) {
130
- return jm .kubeClient .BatchV1beta1 ().CronJobs (metav1 .NamespaceAll ).List (context .TODO (), opts )
131
- }
132
127
133
128
jobsByCj := groupJobsByParent (js )
134
129
klog .V (4 ).Infof ("Found %d groups" , len (jobsByCj ))
135
- err = pager .New (pager .SimplePageFunc (cronJobListFunc )).EachListItem (context .Background (), metav1.ListOptions {}, func (object runtime.Object ) error {
130
+
131
+ err = pager .New (func (ctx context.Context , opts metav1.ListOptions ) (runtime.Object , error ) {
132
+ return jm .kubeClient .BatchV1beta1 ().CronJobs (metav1 .NamespaceAll ).List (ctx , opts )
133
+ }).EachListItem (context .Background (), metav1.ListOptions {}, func (object runtime.Object ) error {
136
134
cj , ok := object .(* batchv1beta1.CronJob )
137
135
if ! ok {
138
136
return fmt .Errorf ("expected type *batchv1beta1.CronJob, got type %T" , cj )
You can’t perform that action at this time.
0 commit comments