Skip to content
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

Refactor: Reconcile loggers, prepare for concurrent reconcilers #1836

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Baarsgaard
Copy link
Contributor

@Baarsgaard Baarsgaard commented Jan 23, 2025

Was looking to implement an option for configuring MaxConcurrentReconciles when registering controllers.
But realised that the Reconciler structs seem to be shared across reconcile requests, meaning r.Log could be replaced with context values from a later reconcileRequest.
This is especially likely for GrafanaContactPoints due to the Watches in GrafanaNotificationPolicy.

Kubebuilder suggests using the plain log := log.FromContext(ctx)

Kubebuilder recommends to always have the ctx as the first argument and I have ensure that is the case as much as possible: kubebuilder controller-implementation

@github-actions github-actions bot added the refactor this PR refactors code without introducing functionality label Jan 23, 2025
@Baarsgaard Baarsgaard force-pushed the refactor_reconcile_loggers_prep_concurrent_reconciles branch from eb0e9ca to c2d45cb Compare January 23, 2025 18:10
@Baarsgaard Baarsgaard marked this pull request as ready for review January 23, 2025 18:17
@Baarsgaard Baarsgaard force-pushed the refactor_reconcile_loggers_prep_concurrent_reconciles branch from c2d45cb to d7d80cf Compare January 25, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor this PR refactors code without introducing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant