Add Gocritic

This also fixes the issues laid out by gocritic
This commit is contained in:
Sargun Dhillon
2020-12-05 19:09:18 -08:00
parent ffbfe19e78
commit d29adf5ce3
7 changed files with 34 additions and 30 deletions

View File

@@ -303,10 +303,9 @@ func (pc *PodController) Run(ctx context.Context, podSyncWorkers int) (retErr er
// At this point we know that something in .metadata or .spec has changed, so we must proceed to sync the pod.
if key, err := cache.MetaNamespaceKeyFunc(newPod); err != nil {
log.G(ctx).Error(err)
} else {
if podShouldEnqueue(oldPod, newPod) {
pc.k8sQ.AddRateLimited(key)
}
} else if podShouldEnqueue(oldPod, newPod) {
pc.k8sQ.AddRateLimited(key)
}
},
DeleteFunc: func(pod interface{}) {