Skip to content

feature: use watch instead of client get in Reconciler #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

googs1025
Copy link
Member

@googs1025 googs1025 commented Jun 12, 2025

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #431 (comment)

Special notes for your reviewer

Does this PR introduce a user-facing change?

None

@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Jun 12, 2025
@googs1025 googs1025 marked this pull request as draft June 12, 2025 14:43
@googs1025 googs1025 force-pushed the feature/configmaps_watch branch from 717b0f5 to 2a2a44b Compare June 12, 2025 14:47
@googs1025
Copy link
Member Author

wait for : #443
then I will test

@googs1025 googs1025 force-pushed the feature/configmaps_watch branch 4 times, most recently from d7f70e4 to 957a98a Compare July 3, 2025 05:34
@googs1025 googs1025 force-pushed the feature/configmaps_watch branch from 957a98a to fa5ab4b Compare July 3, 2025 05:35
@@ -160,9 +161,39 @@ func (r *ServiceReconciler) SetupWithManager(mgr ctrl.Manager) error {
return !reflect.DeepEqual(oldBar.Status, newBar.Status)
},
})).
Watches(&corev1.ConfigMap{}, handler.EnqueueRequestsFromMapFunc(r.updateGlobalConfig),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use watch instead of getting configmap every loop, which reduces calls to the api-server.

@googs1025 googs1025 marked this pull request as ready for review July 3, 2025 06:06
@kerthcet
Copy link
Member

kerthcet commented Jul 4, 2025

will review tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/needs-kind Indicates a PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants