-
Notifications
You must be signed in to change notification settings - Fork 288
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
Update status message to show upgrade type #7518
Conversation
b5777a7
to
638bac0
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7518 +/- ##
==========================================
+ Coverage 73.48% 73.56% +0.07%
==========================================
Files 579 580 +1
Lines 36357 36504 +147
==========================================
+ Hits 26718 26853 +135
- Misses 7875 7888 +13
+ Partials 1764 1763 -1 ☔ View full report in Codecov by Sentry. |
638bac0
to
da830a5
Compare
da830a5
to
0c7c00f
Compare
0c7c00f
to
d063115
Compare
pkg/controller/clusters/status.go
Outdated
upgradeReason := anywherev1.RollingUpgradeInProgress | ||
if cluster.Spec.ControlPlaneConfiguration.UpgradeRolloutStrategy != nil { | ||
if cluster.Spec.ControlPlaneConfiguration.UpgradeRolloutStrategy.Type == anywherev1.InPlaceStrategyType { | ||
upgradeReason = anywherev1.InPlaceUpgradeInProgress | ||
} | ||
} | ||
conditions.MarkFalse(cluster, anywherev1.ControlPlaneReadyCondition, upgradeReason, clusterv1.ConditionSeverityInfo, "Etcd is not ready") |
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.
InPlace is not supported for external etcd. I'd remove this
@@ -218,7 +230,13 @@ func updateWorkersReadyCondition(cluster *anywherev1.Cluster, machineDeployments | |||
// so reflect that on the conditon with an appropriate message. | |||
totalOutdated := totalReplicas - totalUpdatedReplicas | |||
if totalOutdated > 0 { | |||
conditions.MarkFalse(cluster, anywherev1.WorkersReadyCondition, anywherev1.RollingUpgradeInProgress, clusterv1.ConditionSeverityInfo, "Worker nodes not up-to-date yet, %d rolling (%d up to date)", totalReplicas, totalUpdatedReplicas) | |||
upgradeReason := anywherev1.RollingUpgradeInProgress | |||
if cluster.Spec.ControlPlaneConfiguration.UpgradeRolloutStrategy != nil { |
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.
nit: can you add a comment saying we are using cp's upgrade strategy here because we already validate that all the machines have the same upgrade strategy.
// func TestUpdateClusterStatusForInPlaceUpgrades(t *testing.T) { | ||
// g := NewWithT(t) | ||
|
||
// tests := []struct { | ||
// name string | ||
// machineDeployments []clusterv1.MachineDeployment | ||
// workerNodeGroupConfigurations []anywherev1.WorkerNodeGroupConfiguration | ||
// conditions []anywherev1.Condition | ||
// wantCondition *anywherev1.Condition | ||
// wantErr string | ||
// }{ | ||
// { | ||
// name: "control plane replicas out of date, inplace upgrade", | ||
// kcp: test.KubeadmControlPlane(func(kcp *controlplanev1.KubeadmControlPlane) { | ||
// kcp.Status.ReadyReplicas = 3 | ||
// kcp.Status.Replicas = 3 | ||
// kcp.Status.UpdatedReplicas = 1 | ||
|
||
// kcp.Status.Conditions = []clusterv1.Condition{ | ||
// { |
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.
remove commented code
d063115
to
05f34d8
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
/woof
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. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavmpandey08 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 |
Issue #, if available:
Description of changes:
Update cluster status to show
RollingUpgradeInProgress
when the upgrade type isrollingUpgrade
andInPlaceUpgradeInProgress
when the upgrade type isinPlace
.For worker nodes, it will show
RollingUpgradeInProgress
if all nodes have upgrade typerollingUpgrade
,InPlaceUpgradeInProgress
when the upgrade type isinPlace
, andUpgradeInProgress
if there is a combination of both upgrade types.Testing (if applicable):
Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.