@@ -35,17 +35,17 @@ func NewEnqueueRequestGatewayEvent(log gwlog.Logger, client client.Client) handl
3535
3636var ZeroTransitionTime = metav1 .NewTime (time.Time {})
3737
38- func (h * enqueueRequestsForGatewayEvent ) Create (e event.CreateEvent , queue workqueue.RateLimitingInterface ) {
38+ func (h * enqueueRequestsForGatewayEvent ) Create (ctx context. Context , e event.CreateEvent , queue workqueue.RateLimitingInterface ) {
3939 gwNew := e .Object .(* gateway_api.Gateway )
4040
4141 h .log .Infof ("Received Create event for Gateway %s-%s" , gwNew .Name , gwNew .Namespace )
4242
4343 // initialize transition time
4444 gwNew .Status .Conditions [0 ].LastTransitionTime = ZeroTransitionTime
45- h .enqueueImpactedRoutes (queue )
45+ h .enqueueImpactedRoutes (ctx , queue )
4646}
4747
48- func (h * enqueueRequestsForGatewayEvent ) Update (e event.UpdateEvent , queue workqueue.RateLimitingInterface ) {
48+ func (h * enqueueRequestsForGatewayEvent ) Update (ctx context. Context , e event.UpdateEvent , queue workqueue.RateLimitingInterface ) {
4949 gwOld := e .ObjectOld .(* gateway_api.Gateway )
5050 gwNew := e .ObjectNew .(* gateway_api.Gateway )
5151
@@ -54,20 +54,20 @@ func (h *enqueueRequestsForGatewayEvent) Update(e event.UpdateEvent, queue workq
5454 if ! equality .Semantic .DeepEqual (gwOld .Spec , gwNew .Spec ) {
5555 // initialize transition time
5656 gwNew .Status .Conditions [0 ].LastTransitionTime = ZeroTransitionTime
57- h .enqueueImpactedRoutes (queue )
57+ h .enqueueImpactedRoutes (ctx , queue )
5858 }
5959}
6060
61- func (h * enqueueRequestsForGatewayEvent ) Delete (e event.DeleteEvent , queue workqueue.RateLimitingInterface ) {
61+ func (h * enqueueRequestsForGatewayEvent ) Delete (ctx context. Context , e event.DeleteEvent , queue workqueue.RateLimitingInterface ) {
6262 // TODO: delete gateway
6363}
6464
65- func (h * enqueueRequestsForGatewayEvent ) Generic (e event.GenericEvent , queue workqueue.RateLimitingInterface ) {
65+ func (h * enqueueRequestsForGatewayEvent ) Generic (ctx context. Context , e event.GenericEvent , queue workqueue.RateLimitingInterface ) {
6666
6767}
6868
69- func (h * enqueueRequestsForGatewayEvent ) enqueueImpactedRoutes (queue workqueue.RateLimitingInterface ) {
70- routes , err := core .ListAllRoutes (context . TODO () , h .client )
69+ func (h * enqueueRequestsForGatewayEvent ) enqueueImpactedRoutes (ctx context. Context , queue workqueue.RateLimitingInterface ) {
70+ routes , err := core .ListAllRoutes (ctx , h .client )
7171 if err != nil {
7272 h .log .Errorf ("Failed to list all routes, %s" , err )
7373 return
@@ -91,7 +91,7 @@ func (h *enqueueRequestsForGatewayEvent) enqueueImpactedRoutes(queue workqueue.R
9191 }
9292
9393 gw := & gateway_api.Gateway {}
94- if err := h .client .Get (context . TODO () , gwName , gw ); err != nil {
94+ if err := h .client .Get (ctx , gwName , gw ); err != nil {
9595 h .log .Debugf ("Ignoring Route with unknown parentRef %s-%s" , route .Name (), route .Namespace ())
9696 continue
9797 }
@@ -103,7 +103,7 @@ func (h *enqueueRequestsForGatewayEvent) enqueueImpactedRoutes(queue workqueue.R
103103 Name : string (gw .Spec .GatewayClassName ),
104104 }
105105
106- if err := h .client .Get (context . TODO () , gwClassName , gwClass ); err != nil {
106+ if err := h .client .Get (ctx , gwClassName , gwClass ); err != nil {
107107 h .log .Debugf ("Ignoring Route with unknown Gateway %s-%s" , route .Name (), route .Namespace ())
108108 continue
109109 }
0 commit comments