-
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
🐛 KCP should update conditions when reconcileHealth is failing #3879
🐛 KCP should update conditions when reconcileHealth is failing #3879
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
/milestone v0.3.11 |
// Control plane machines rollout due to configuration changes (e.g. upgrades) takes precedence over other operations. | ||
needRollout := controlPlane.MachinesNeedingRollout() | ||
switch { | ||
case len(needRollout) > 0: | ||
logger.Info("Rolling out Control Plane machines", "needRollout", needRollout.Names()) | ||
// NOTE: we are using Status.UpdatedReplicas from the previous reconciliation only to provide a meaningful message | ||
// and this does not influence any reconciliation logic. | ||
conditions.MarkFalse(controlPlane.KCP, controlplanev1.MachinesSpecUpToDateCondition, controlplanev1.RollingUpdateInProgressReason, clusterv1.ConditionSeverityWarning, "Rolling %d replicas with outdated spec (%d replicas up to date)", len(needRollout), kcp.Status.UpdatedReplicas) | ||
conditions.MarkFalse(controlPlane.KCP, controlplanev1.MachinesSpecUpToDateCondition, controlplanev1.RollingUpdateInProgressReason, clusterv1.ConditionSeverityWarning, "Rolling %d replicas with outdated spec (%d replicas up to date)", len(needRollout), len(controlPlane.Machines)-len(needRollout)) |
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.
Switching to len(controlPlane.Machines)-len(needRollout)
because it relies on the same information used in this func (instead of relying on a valued computed somewhere else).
But this is a nit, the real fix to the issue is moving reconcileHealth
back into ScaleUpControlPane
and scaleDownControlPlane
.
/test pull-cluster-api-test-release-0-3 |
@fabriziopandini: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
/hold |
/close |
@fabriziopandini: Closed this PR. In response to this:
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. |
What this PR does / why we need it:
This PR fixes a bug introduced by #3806 preventing KCP conditions to be updated when reconcileHealth is failing
Which issue(s) this PR fixes:
Fixes #3862