-
Notifications
You must be signed in to change notification settings - Fork 83
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
checontroller refactoring #1138
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1138 +/- ##
==========================================
+ Coverage 54.64% 57.19% +2.54%
==========================================
Files 69 70 +1
Lines 8421 8440 +19
==========================================
+ Hits 4602 4827 +225
+ Misses 3338 3099 -239
- Partials 481 514 +33
Continue to review full report at Codecov.
|
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the way how we register components' reconcilers
} | ||
|
||
if !util.IsCheMultiUser(ctx.CheCluster) { | ||
return reconcile.Result{}, false, fmt.Errorf("Single user authentication mode is not supported anymore. To backup your data you can commit workspace configuration to an SCM server and use factories to restore it in multi user mode. To switch to multi user authentication mode set 'spec.server.customCheProperties.CHE_MULTIUSER' to 'true' in %s CheCluster custom resource. Switching to multi user authentication mode without backing up your data will cause data loss.", ctx.CheCluster.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move such long messages into constant of a function if the message should be constructed. I think it will make code easier to read.
pkg/deploy/reconcile_manager.go
Outdated
|
||
// Reconcile all objects in a order they have been added | ||
// If reconciliation failed then CheCluster status will be updated accordingly. | ||
func (rm *ReconcileManager) ReconcileAll(ctx *DeployContext) (reconcile.Result, bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename rm
. Maybe just manager
?
pkg/deploy/reconcile_manager.go
Outdated
return reconcile.Result{}, true, nil | ||
} | ||
|
||
func (sm *ReconcileManager) FinalizeAll(ctx *DeployContext) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename
pkg/deploy/reconcile_manager.go
Outdated
// Does finalization (removes cluster scope objects, etc) | ||
Finalize(ctx *DeployContext) (done bool, err error) | ||
// Does registration | ||
Register(rm *ReconcileManager) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This duplicates RegisterReconciler
method of the manager. It is redundant.
cheClusterValidator := NewCheClusterValidator() | ||
cheClusterValidator.Register(reconcileManager) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to use reconcileManager.Register(NewCheClusterValidator())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mmorhun, tolusha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
@tolusha: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What does this PR do?
TODO
Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
eclipse-che/che#19978
How to test this PR?
N/A
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.