kubernetes-sigs / kueue

Kubernetes-native Job Queueing
https://kueue.sigs.k8s.io
Apache License 2.0
1.25k stars 222 forks source link

cleanup manipulation of CQ/Cohort resource accounting in tests #2502

Open gabesaba opened 6 days ago

gabesaba commented 6 days ago

What would you like to be cleaned: We sometimes manipulate the internal accounting of ClusterQueue and Cohort snapshots. This is brittle. Quota/Lending Limit/Borrowing Limit/Usage should be set by calling public api methods, or by defining the CQs/Cohorts via API objects, adding to cache, and creating snapshot (see #2486 for an example).

See this thread https://github.com/kubernetes-sigs/kueue/pull/2486#discussion_r1658747058

Why is this needed: Tests are brittle, and make cache/snapshot hard to update

alculquicondor commented 6 days ago

Also https://github.com/kubernetes-sigs/kueue/pull/2486#discussion_r1658976669