clusterroleaggregation: use contextual logging

This commit is contained in:
Mengjiao Liu
2022-11-15 18:02:37 +08:00
parent 3cfa245342
commit c28b287253
2 changed files with 5 additions and 2 deletions

View File

@@ -185,8 +185,9 @@ func (c *ClusterRoleAggregationController) Run(ctx context.Context, workers int)
defer utilruntime.HandleCrash()
defer c.queue.ShutDown()
klog.Infof("Starting ClusterRoleAggregator")
defer klog.Infof("Shutting down ClusterRoleAggregator")
logger := klog.FromContext(ctx)
logger.Info("Starting ClusterRoleAggregator controller")
defer logger.Info("Shutting down ClusterRoleAggregator controller")
if !cache.WaitForNamedCacheSync("ClusterRoleAggregator", ctx.Done(), c.clusterRolesSynced) {
return