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 MantleBackup reconciler #38

Merged
merged 11 commits into from
Sep 18, 2024
Merged

Refactor MantleBackup reconciler #38

merged 11 commits into from
Sep 18, 2024

Conversation

toshipp
Copy link
Contributor

@toshipp toshipp commented Sep 17, 2024

see commit messages.

PV is cluster resource, it is not needed.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
It is a rafactoring, no functional changes.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
It is a refactoring, no functional changes.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
It is a refactoring, no functional changes.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
The logic scattered in two position, dedup them to one on the Reconcile
method for better understanding.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
It is an error case, return err instead of nil.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
To make Reconcile method small and ease understanding, move them into
it.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
It is more direct.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
It is used from controllers rather than NewMantleBackupReconciler. No
functional changes.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
We used the global logger in many places in spite of making custom
loggers in Reconcilers. To fix it, add a parameter to give a logger and
rename the global logger.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
@toshipp toshipp marked this pull request as ready for review September 17, 2024 10:27
@satoru-takeuchi satoru-takeuchi requested review from ushitora-anqou and removed request for satoru-takeuchi September 18, 2024 00:56
The function not only create snap and update status but also add labels
and check preconditions, so change the name to a more appropriate one.

Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
@ushitora-anqou ushitora-anqou merged commit 031a953 into main Sep 18, 2024
3 checks passed
@ushitora-anqou ushitora-anqou deleted the refactoring branch September 18, 2024 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants