Fix kueue updates and improve reconciler#63
Open
tkatila wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR optimizes the misc controller reconcile flow by retrieving the cluster’s CRD names once per ClusterPolicy reconcile and reusing the result, while also improving Kueue object reconciliation to update labels consistently and clean up stale queues.
Changes:
- Retrieve CRD name list once in
ClusterPolicyReconcilerand pass it intoMiscReconcilerto avoid repeated CRD listing. - Improve Kueue reconciliation by ensuring
ownerlabeling is applied/updated and by deleting stale ClusterQueues/LocalQueues when policy changes. - Add tests for stale Kueue queue cleanup and for using
APIReaderduring LocalQueue cleanup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| internal/controller/misc_controller.go | Reworks CRD existence checks to use pre-fetched CRD names, adds Kueue stale-queue cleanup, and updates label handling + LocalQueue listing via APIReader. |
| internal/controller/clusterpolicy_controller.go | Fetches CRD names once per reconcile and passes them into sub-reconcilers; wires APIReader from manager. |
| internal/controller/misc_controller_test.go | Updates tests for new owner-label behavior and adds coverage for stale queue cleanup + APIReader usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tkatila
force-pushed
the
fix-kueue-updates-faster-reconciler
branch
from
July 21, 2026 12:33
0654908 to
d0a2d8c
Compare
When clusterpolicy was edited with different localqueues, controller left previous queues in the cluster. They should be removed. Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
Operator uses a cached client to list cluster objects. As LocalQueues were not requested to be cached, they couldn't be listed with the client. ClusterQueues are cluster-wide so they seem to be cache by default, so they were found correctly. Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
misc controller has conditional paths that depend on CRDs installed to the cluster. Misc controller queried CRDs a few times which resulted in misc controller being slow. The difference is a few seconds on my test bench. Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
tkatila
force-pushed
the
fix-kueue-updates-faster-reconciler
branch
from
July 21, 2026 12:42
d0a2d8c to
46e1a99
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retrieving CRDs seems to be slow and misc_controller was querying them many times. By retrieving them once, makes misc_controller reconciler much faster.