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.
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 Machine and KCP conditions to KCP controller #3674
🌱Add Machine and KCP conditions to KCP controller #3674
Changes from all commits
1b7d9ea
3836c76
849c5d3
f70db9e
efba223
bb8c4b5
e2d6f83
f984dba
800b8dd
b52b9b7
846573d
c512676
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 method is a little misleading,
createControlPlane
made me think that we were creating (read initializing) a new control plane, rather than the struct.If the internal control plane struct requires more information, can we enrich
internal.NewControlPlane
to do it for us instead?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 is getting the owned machines and then create ControlPlane, added because we will do the same thing in both reconcile and reconcileDelete. Although ControlPlane struct is enough as it is, ownedMachines are also calculated here. I think this is a good abstraction, but maybe bad naming?
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 guess this is because we are delegating the responsibility to update machine conditions to reconcileControlPlaneHealth.
If this is the case, then I see two potential states when we won't upgrade machine conditions:
Have you considered these use cases? a possible idea to address this is to assign the responsibility to update machine to updateStatus?
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.
Machine remediation will call
reconcileControlPlaneHealth
, right? If it gets called then the conditions will be updated.It doesn't cover delete workflow because we don't call
reconcileControlPlaneHealth
, and hence these conditions will not be updated. During deletion Machines will signal as deleting andNodeHealthy
condition will signal the deletion so it may be unnecessary to do a health check on pods during deletion.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 not sure we will call reconcileControlPlaneHealth during remediation because remediation should happen before we are checking reconcileControlPlaneHealth (also, curently we are returning if cluster is unhealthy)
This is why I was suggesting to consider have this code in updateStatus
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.
Added reconcileHealth to reconcile delete with the minimum changes possible.
Ideally,
TargetClusterEtcdIsHealthy
andTargetClusterControlPlaneIsHealthy
could be removed totally, but did not do that in this PR.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.
Had to remove error checks for
TargetClusterEtcdIsHealthy
andTargetClusterControlPlaneIsHealthy
during reconcileDelete because control plane may be unreachable during delete.