pbacsko commented on code in PR #605:
URL: https://github.com/apache/yunikorn-k8shim/pull/605#discussion_r1212159512
##########
pkg/cache/context_recovery.go:
##########
@@ -80,86 +73,77 @@ func (ctx *Context) recover(mgr []interfaces.Recoverable,
due time.Duration) err
ctx.nodes.addAndReportNode(node, false)
}
- // current, disable getting pods for a node during test,
- // because in the tests, we don't really send existing allocations
- // we simply simulate to accept or reject nodes on conditions.
- if !ctx.apiProvider.IsTestingMode() {
- var podList *corev1.PodList
- podList, err =
ctx.apiProvider.GetAPIs().KubeClient.GetClientSet().
- CoreV1().Pods("").
- List(context.Background(), metav1.ListOptions{})
- if err != nil {
- return err
- }
+ pods, err :=
ctx.apiProvider.GetAPIs().PodInformer.Lister().List(labels.Everything())
Review Comment:
I rewrote this to `PodInformer.Lister().List()`, documentation says it's
faster.
Although at this point, we already have the list of pods from a previous
listing, so we can even skip this (perhaps implement this in a separate JIRA?).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]