-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add KCP conditions, split reconcileHealth into preflight and reconcileEtcdMembers, make both use conditions #3900
Add KCP conditions, split reconcileHealth into preflight and reconcileEtcdMembers, make both use conditions #3900
Conversation
/milestone v0.3.11 |
/pull-cluster-api-e2e-full-release-0-3 |
7f75d8e
to
b139214
Compare
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.
Code is much more cleaner and readable. Thanks for doing this big refactoring @fabriziopandini
Have a few comments, nothing important in terms of logic.
I will continue reviewing worload_cluster_conditions.go.
/lgtm |
Now reviewing this PR /hold |
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.
I'm ~80% of the way to finish the review, although I'd like to get these comments out there first and then proceed.
Let's also please change the title of this PR with something more descriptive. There way lots of changes included and it'd be great to capture them in the release notes.
workloadCluster.UpdateStaticPodConditions(ctx, controlPlane.KCP, controlPlane.Machines.UnsortedList()) | ||
workloadCluster.UpdateEtcdConditions(ctx, controlPlane.KCP, controlPlane.Machines.UnsortedList()) |
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 are these methods on workload cluster? Aren't the conditions updated on the KCP object?
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.
You are right, condition are set on machines and KCP objects, but conditions are based on the observation of the workload cluster.
Also, we are using several workloadcluster internals link getControlPlaneNodes, etcdClientGenerator and moving this code somewhere else will requires to make that method public, but if you think this makes sense I can move this under controllers conditions.go
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 open an issue to cleanup all these structs, they're really confusing
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.
As per https://kubernetes.slack.com/archives/C8TSNPY4T/p1604601792219100, I will open an issue so we can reconsider this in v1alpha4
/retitle Add KCP conditions, split reconcileHealth into preflight and reconcileEtcdMembers, make both use conditions |
8f95e8c
to
2f641dd
Compare
/hold cancel |
…eEtcdMembers, make both use conditions
2f641dd
to
e400d47
Compare
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.
/approve
/lgtm
/pull-cluster-api-e2e-full-release-0-3 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
This PR adds KCP specific conditions to KCP itself and to machines providing visibility in:
The initial PR attempt was based on the idea of assigning to
reconcileHealth
the additional responsibility of computing conditions, however, after discovering a few problems during tests it was decided to propose a bigger refactor thatreconcileControlPlaneConditions
func and toworkloadcluster.UpdateStaticPodConditions
andworkloadcluster.UpdateEtcdConditions
reconcileHealth
withpreflightChecks
, now based on conditions state.reconcileEtcdMembers
, for taking care of etcd members without machines (before this was improperly implemented inreconcileHealth
Which issue(s) this PR fixes:
Fixes #3138
Fixes #3862
Fixes #3861
Fixes #3875