From 87bdb70d76f4465b96052abc88a1b3e6c7fcd06b Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Mon, 7 Aug 2023 12:04:44 +0200 Subject: [PATCH] Use receive-only channels for stopping controllers --- pkg/controller/queuejob/queuejob_controller_ex.go | 2 +- pkg/controller/queuejobdispatch/queuejobagent.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller/queuejob/queuejob_controller_ex.go b/pkg/controller/queuejob/queuejob_controller_ex.go index 612a3cb7b..97b3dc811 100644 --- a/pkg/controller/queuejob/queuejob_controller_ex.go +++ b/pkg/controller/queuejob/queuejob_controller_ex.go @@ -1407,7 +1407,7 @@ func (qjm *XController) backoff(ctx context.Context, q *arbv1.AppWrapper, reason } // Run starts AppWrapper Controller -func (cc *XController) Run(stopCh chan struct{}) { +func (cc *XController) Run(stopCh <-chan struct{}) { go cc.appwrapperInformer.Informer().Run(stopCh) go cc.qjobResControls[arbv1.ResourceTypePod].Run(stopCh) diff --git a/pkg/controller/queuejobdispatch/queuejobagent.go b/pkg/controller/queuejobdispatch/queuejobagent.go index ad341cf39..4d6820635 100644 --- a/pkg/controller/queuejobdispatch/queuejobagent.go +++ b/pkg/controller/queuejobdispatch/queuejobagent.go @@ -153,7 +153,7 @@ func (cc *JobClusterAgent) deleteQueueJob(obj interface{}) { cc.agentEventQueue.Add(qj) } -func (qa *JobClusterAgent) Run(stopCh chan struct{}) { +func (qa *JobClusterAgent) Run(stopCh <-chan struct{}) { go qa.jobInformer.Informer().Run(stopCh) cache.WaitForCacheSync(stopCh, qa.jobSynced) }