-
Notifications
You must be signed in to change notification settings - Fork 19
Introduce generic reconciler and migrate ClickhouseUser #1067
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
Merged
byashimov
merged 1 commit into
main
from
akarpov/chore/nex-2037-clickhouse-new-reconciliation
Nov 28, 2025
Merged
Introduce generic reconciler and migrate ClickhouseUser #1067
byashimov
merged 1 commit into
main
from
akarpov/chore/nex-2037-clickhouse-new-reconciliation
Nov 28, 2025
Conversation
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
ndk
commented
Nov 17, 2025
ndk
commented
Nov 17, 2025
ndk
commented
Nov 17, 2025
ndk
commented
Nov 17, 2025
ndk
commented
Nov 17, 2025
vmyroslav
reviewed
Nov 17, 2025
2fbdd0e to
0c72a17
Compare
byashimov
reviewed
Nov 20, 2025
byashimov
reviewed
Nov 20, 2025
byashimov
reviewed
Nov 20, 2025
a3f5954 to
16c5c4d
Compare
vmyroslav
reviewed
Nov 25, 2025
vmyroslav
reviewed
Nov 25, 2025
e71b823 to
76a3a97
Compare
76a3a97 to
495181c
Compare
ndk
commented
Nov 28, 2025
byashimov
approved these changes
Nov 28, 2025
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.
About this change—what it does
This PR introduces a generic
Reconciler[T]forAivenManagedObjectresources and wires the new ClickhouseUser v2 controller through it. The oldClickhouseUsercontroller andbasic_controllerremain as-is. The new stack is opt-in behind an env flag.Resolves: #NEX-2037.
Why this way
The generic reconciler owns the full control flow. Resource-specific code only implements
AivenController[T](Observe/Create/Update/Delete).flowchart TD A[Reconcile] --> B[Get object] B --> C[Build Aiven client] C --> D{Marked for deletion?} D -->|yes| F[Finalize & remove finalizer] D -->|no| E[Ensure instance finalizer] E --> G[Observe] G --> H{Preconditions OK?} H -->|error| H1[Set error condition\nrequeue short] H -->|no| H2[Not met\nrequeue short] H -->|yes| I{Resource exists?} I -->|no| J[Create] J --> J1[Emit create events] J1 --> J2[Requeue pollInterval] I -->|yes| K{Up to date?} K -->|no| L[Update] L --> L1[Emit update events] L1 --> L2[Sync Secret if needed] L2 --> L3[Requeue pollInterval] K -->|yes| M[Steady state] M --> M1[Requeue pollInterval]Key points:
newControllerreceives a readyavngen.Client.updateStatus) reuses one implementation:DeepEqual+RetryOnConflictfor object and status.Create,Update, do nothing uses only:Observation.ResourceExistsObservation.ResourceUpToDatePlus
PreconditionsMet/PreconditionErrorto short-circuit when the parent service or environment is not ready.UpdateResult.SecretDetailsviasyncConnectionSecret.The idea is that new controllers only need to describe "how to talk to Aiven" in
AivenController[T], while the Kubernetes mechanics (finalizers, conditions, events, requeue policy, secrets, status updates) are implemented once inReconciler[T].