File tree Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ import (
33
33
"sigs.k8s.io/controller-runtime/pkg/controller"
34
34
"sigs.k8s.io/controller-runtime/pkg/handler"
35
35
"sigs.k8s.io/controller-runtime/pkg/log"
36
- "sigs.k8s.io/controller-runtime/pkg/source"
37
-
38
36
schedv1alpha1 "sigs.k8s.io/scheduler-plugins/apis/scheduling/v1alpha1"
39
37
)
40
38
@@ -173,7 +171,7 @@ func newZeroUsed(eq *schedv1alpha1.ElasticQuota) v1.ResourceList {
173
171
func (r * ElasticQuotaReconciler ) SetupWithManager (mgr ctrl.Manager ) error {
174
172
r .recorder = mgr .GetEventRecorderFor ("ElasticQuotaController" )
175
173
return ctrl .NewControllerManagedBy (mgr ).
176
- Watches (& source. Kind { Type : & v1.Pod {} }, & handler.EnqueueRequestForObject {}).
174
+ Watches (& v1.Pod {}, & handler.EnqueueRequestForObject {}).
177
175
For (& schedv1alpha1.ElasticQuota {}).
178
176
WithOptions (controller.Options {MaxConcurrentReconciles : r .Workers }).
179
177
Complete (r )
Original file line number Diff line number Diff line change @@ -36,8 +36,6 @@ import (
36
36
"sigs.k8s.io/controller-runtime/pkg/controller"
37
37
"sigs.k8s.io/controller-runtime/pkg/handler"
38
38
"sigs.k8s.io/controller-runtime/pkg/log"
39
- "sigs.k8s.io/controller-runtime/pkg/source"
40
-
41
39
schedv1alpha1 "sigs.k8s.io/scheduler-plugins/apis/scheduling/v1alpha1"
42
40
"sigs.k8s.io/scheduler-plugins/pkg/util"
43
41
)
@@ -191,14 +189,13 @@ func (r *PodGroupReconciler) SetupWithManager(mgr ctrl.Manager) error {
191
189
r .log = mgr .GetLogger ()
192
190
193
191
return ctrl .NewControllerManagedBy (mgr ).
194
- Watches (& source.Kind {Type : & v1.Pod {}},
195
- handler .EnqueueRequestsFromMapFunc (r .podToPodGroup )).
192
+ Watches (& v1.Pod {}, handler .EnqueueRequestsFromMapFunc (r .podToPodGroup )).
196
193
For (& schedv1alpha1.PodGroup {}).
197
194
WithOptions (controller.Options {MaxConcurrentReconciles : r .Workers }).
198
195
Complete (r )
199
196
}
200
197
201
- func (r * PodGroupReconciler ) podToPodGroup (obj client.Object ) []ctrl.Request {
198
+ func (r * PodGroupReconciler ) podToPodGroup (ctx context. Context , obj client.Object ) []ctrl.Request {
202
199
pod , ok := obj .(* v1.Pod )
203
200
if ! ok {
204
201
return nil
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ func Test_Run(t *testing.T) {
166
166
}
167
167
for _ , p := range ps {
168
168
kClient .Status ().Update (ctx , p )
169
- reqs := controller .podToPodGroup (p )
169
+ reqs := controller .podToPodGroup (ctx , p )
170
170
for _ , req := range reqs {
171
171
if _ , err := controller .Reconcile (ctx , req ); err != nil {
172
172
t .Errorf ("reconcile: (%v)" , err )
You can’t perform that action at this time.
0 commit comments