diff --git a/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go b/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go index 214ce45c..d2f1c8cf 100644 --- a/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go +++ b/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go @@ -737,7 +737,7 @@ func (r *PackageVariantReconciler) SetupWithManager(mgr ctrl.Manager) error { func mapObjectsToRequests(mgrClient client.Reader) handler.MapFunc { return func(ctx context.Context, obj client.Object) []reconcile.Request { attachedPackageVariants := &api.PackageVariantList{} - err := mgrClient.List(context.TODO(), attachedPackageVariants, &client.ListOptions{ + err := mgrClient.List(ctx, attachedPackageVariants, &client.ListOptions{ Namespace: obj.GetNamespace(), }) if err != nil { diff --git a/controllers/packagevariantsets/pkg/controllers/packagevariantset/packagevariantset_controller.go b/controllers/packagevariantsets/pkg/controllers/packagevariantset/packagevariantset_controller.go index 24c94d8a..292aa979 100644 --- a/controllers/packagevariantsets/pkg/controllers/packagevariantset/packagevariantset_controller.go +++ b/controllers/packagevariantsets/pkg/controllers/packagevariantset/packagevariantset_controller.go @@ -399,7 +399,7 @@ func (r *PackageVariantSetReconciler) SetupWithManager(mgr ctrl.Manager) error { func mapObjectsToRequests(mgrClient client.Reader) handler.MapFunc { return func(ctx context.Context, obj client.Object) []reconcile.Request { attachedPackageVariants := &api.PackageVariantSetList{} - err := mgrClient.List(context.TODO(), attachedPackageVariants, &client.ListOptions{ + err := mgrClient.List(ctx, attachedPackageVariants, &client.ListOptions{ Namespace: obj.GetNamespace(), }) if err != nil {