controller: introduce reconcileResult for MantleBackupReconciler#299
Merged
Conversation
61079c5 to
1850105
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the MantleBackup controller’s reconciliation flow to use a unified reconcileResult abstraction and introduces/uses a mantle.cybozu.io/cluster-id label to help ensure MantleBackup resources are processed by the correct controller in multi-controller environments.
Changes:
- Added
reconcileResulthelper type to standardize “success / requeue / error” outcomes across controller helper methods. - Updated MantleBackup controller logic to return
*reconcileResultfrom many helpers and addedcheckManagedBackup()gating logic based on cluster identity. - Updated controller tests to adapt to the new
reconcileResultreturn style.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| internal/controller/reconcile_result.go | New reconcileResult type and helpers to convert internal outcomes to (ctrl.Result, error). |
| internal/controller/mantlebackup_controller.go | Refactors reconciliation to use reconcileResult; adds cluster-id label usage and checkManagedBackup() filtering. |
| internal/controller/mantlebackup_controller_test.go | Updates tests to work with reconcileResult (getResult() calls). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bf66549 to
7363ce7
Compare
afc4900 to
753e09c
Compare
2a50a7d to
2e3c5f8
Compare
0417992 to
41d7edc
Compare
ushitora-anqou
requested changes
Jul 1, 2026
Replace the (ctrl.Result, error) return convention used throughout MantleBackupReconciler's helper methods with a single *reconcile.Result value. reconcile.Result encodes exactly one of four outcomes: success, requeue, error, or "continue" (nil), which makes the control flow of each step explicit and removes the need to juggle ctrl.Result and error side by side at every call site. Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
41d7edc to
19fdf2b
Compare
ushitora-anqou
approved these changes
Jul 2, 2026
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.
No description provided.