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