File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -297,25 +297,14 @@ func (c completedConfig) NewWithDelegate(delegationTarget genericapiserver.Deleg
297
297
}
298
298
// We are passing the context to ProxyCerts.RunOnce as it needs to implement RunOnce(ctx) however the
299
299
// context is not used at all. So passing a empty context shouldn't be a problem
300
- ctx := context .TODO ()
301
- if err := aggregatorProxyCerts .RunOnce (ctx ); err != nil {
300
+ if err := aggregatorProxyCerts .RunOnce (context .Background ()); err != nil {
302
301
return nil , err
303
302
}
304
303
aggregatorProxyCerts .AddListener (apiserviceRegistrationController )
305
304
s .proxyCurrentCertKeyContent = aggregatorProxyCerts .CurrentCertKeyContent
306
305
307
306
s .GenericAPIServer .AddPostStartHookOrDie ("aggregator-reload-proxy-client-cert" , func (postStartHookContext genericapiserver.PostStartHookContext ) error {
308
- // generate a context from stopCh. This is to avoid modifying files which are relying on apiserver
309
- // TODO: See if we can pass ctx to the current method
310
- ctx , cancel := context .WithCancel (context .Background ())
311
- go func () {
312
- select {
313
- case <- postStartHookContext .Done ():
314
- cancel () // stopCh closed, so cancel our context
315
- case <- ctx .Done ():
316
- }
317
- }()
318
- go aggregatorProxyCerts .Run (ctx , 1 )
307
+ go aggregatorProxyCerts .Run (postStartHookContext , 1 )
319
308
return nil
320
309
})
321
310
}
You can’t perform that action at this time.
0 commit comments