PoAn Yang created YUNIKORN-1772:
-----------------------------------

             Summary: Simplify the cache Context.SelectApplications function
                 Key: YUNIKORN-1772
                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1772
             Project: Apache YuniKorn
          Issue Type: Improvement
          Components: shim - kubernetes
            Reporter: PoAn Yang
            Assignee: PoAn Yang


In production code, we only use [cache 
Context.SelectApplications|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/cache/context.go#LL928C2-L928C2]
 in 
[KubernetesShim.schedule|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/shim/scheduler.go#L279]
 with a {{nil}} filter.

In testing code, 
[MockScheduler.waitAndAssertApplicationState|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/shim/scheduler_mock_test.go#L155-L157]
 and 
[MockScheduler.waitAndAssertTaskState|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/shim/scheduler_mock_test.go#L193]
 use it to filter apps by application ID, but this can be replaced by [cache 
Context.GetApplication|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/cache/context.go#L799].

So we can use a new function {{{}GetAllApplications{}}}, and remove 
SelectApplications in the code base.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to