Skip to content

Commit be6ebe7

Browse files
authored
Merge pull request #3777 from vladfr/patch-1
📖 Add context to handler func
2 parents 37790e0 + 79d63f6 commit be6ebe7

File tree

1 file changed

+3
-3
lines changed
  • docs/book/src/reference/watching-resources/testdata/external-indexed-field

1 file changed

+3
-3
lines changed

docs/book/src/reference/watching-resources/testdata/external-indexed-field/controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ func (r *ConfigDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error {
184184
we just need to loop through the list and create a reconcile request for each one.
185185
If an error occurs fetching the list, or no `ConfigDeployments` are found, then no reconcile requests will be returned.
186186
*/
187-
func (r *ConfigDeploymentReconciler) findObjectsForConfigMap(configMap client.Object) []reconcile.Request {
187+
func (r *ConfigDeploymentReconciler) findObjectsForConfigMap(ctx context.Context, configMap client.Object) []reconcile.Request {
188188
attachedConfigDeployments := &appsv1.ConfigDeploymentList{}
189189
listOps := &client.ListOptions{
190190
FieldSelector: fields.OneTermEqualSelector(configMapField, configMap.GetName()),
191191
Namespace: configMap.GetNamespace(),
192192
}
193-
err := r.List(context.TODO(), attachedConfigDeployments, listOps)
193+
err := r.List(ctx, attachedConfigDeployments, listOps)
194194
if err != nil {
195195
return []reconcile.Request{}
196196
}
@@ -205,4 +205,4 @@ func (r *ConfigDeploymentReconciler) findObjectsForConfigMap(configMap client.Ob
205205
}
206206
}
207207
return requests
208-
}
208+
}

0 commit comments

Comments
 (0)