You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by "pbacsko (via GitHub)" <gi...@apache.org> on 2023/05/31 18:48:35 UTC

[GitHub] [yunikorn-k8shim] pbacsko commented on a diff in pull request #605: [YUNIKORN-1744] Enable recovery for MockScheduler

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 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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org