Skip to content

Commit 87540c9

Browse files
sbueringerphoban01
authored andcommitted
🌱 Extend MS ScalingUp and Remediationg conditions to include preflight check errors (kubernetes-sigs#11390)
* Extend MS ScalingUp and Remediationg conditions to include preflight check errors Signed-off-by: Stefan Büringer [email protected] * Always set message on OwnerRemediated condition Signed-off-by: Stefan Büringer [email protected] --------- Signed-off-by: Stefan Büringer [email protected]
1 parent bafbe83 commit 87540c9

12 files changed

+196
-117
lines changed

‎controlplane/kubeadm/internal/controllers/remediation.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@ func (r *KubeadmControlPlaneReconciler) reconcileUnhealthyMachines(ctx context.C
315315
conditions.MarkFalse(machineToBeRemediated, clusterv1.MachineOwnerRemediatedCondition, clusterv1.RemediationInProgressReason, clusterv1.ConditionSeverityWarning, "")
316316

317317
v1beta2conditions.Set(machineToBeRemediated, metav1.Condition{
318-
Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition,
319-
Status: metav1.ConditionFalse,
320-
Reason: controlplanev1.KubeadmControlPlaneMachineRemediationMachineDeletedV1Beta2Reason,
318+
Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition,
319+
Status: metav1.ConditionFalse,
320+
Reason: controlplanev1.KubeadmControlPlaneMachineRemediationMachineDeletedV1Beta2Reason,
321+
Message: "Machine deletionTimestamp set",
321322
})
322323

323324
// Prepare the info for tracking the remediation progress into the RemediationInProgressAnnotation.

‎controlplane/kubeadm/internal/controllers/remediation_test.go

+27-25
Large diffs are not rendered by default.

‎controlplane/kubeadm/internal/controllers/status_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ func Test_setRemediatingCondition(t *testing.T) {
514514
healthCheckSucceeded := clusterv1.Condition{Type: clusterv1.MachineHealthCheckSucceededV1Beta2Condition, Status: corev1.ConditionTrue}
515515
healthCheckNotSucceeded := clusterv1.Condition{Type: clusterv1.MachineHealthCheckSucceededV1Beta2Condition, Status: corev1.ConditionFalse}
516516
ownerRemediated := clusterv1.Condition{Type: clusterv1.MachineOwnerRemediatedCondition, Status: corev1.ConditionFalse}
517-
ownerRemediatedV1Beta2 := metav1.Condition{Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition, Status: metav1.ConditionFalse, Message: "Remediation in progress"}
517+
ownerRemediatedV1Beta2 := metav1.Condition{Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition, Status: metav1.ConditionFalse, Reason: controlplanev1.KubeadmControlPlaneMachineRemediationMachineDeletedV1Beta2Reason, Message: "Machine deletionTimestamp set"}
518518

519519
tests := []struct {
520520
name string
@@ -550,7 +550,7 @@ func Test_setRemediatingCondition(t *testing.T) {
550550
Type: controlplanev1.KubeadmControlPlaneRemediatingV1Beta2Condition,
551551
Status: metav1.ConditionTrue,
552552
Reason: controlplanev1.KubeadmControlPlaneRemediatingV1Beta2Reason,
553-
Message: "Remediation in progress from Machine m3",
553+
Message: "Machine deletionTimestamp set from Machine m3",
554554
},
555555
},
556556
{

‎internal/controllers/cluster/cluster_controller_status_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ func TestSetRemediatingCondition(t *testing.T) {
15021502
healthCheckSucceeded := clusterv1.Condition{Type: clusterv1.MachineHealthCheckSucceededV1Beta2Condition, Status: corev1.ConditionTrue}
15031503
healthCheckNotSucceeded := clusterv1.Condition{Type: clusterv1.MachineHealthCheckSucceededV1Beta2Condition, Status: corev1.ConditionFalse}
15041504
ownerRemediated := clusterv1.Condition{Type: clusterv1.MachineOwnerRemediatedCondition, Status: corev1.ConditionFalse}
1505-
ownerRemediatedV1Beta2 := metav1.Condition{Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition, Status: metav1.ConditionFalse, Message: "Remediation in progress"}
1505+
ownerRemediatedV1Beta2 := metav1.Condition{Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineSetMachineRemediationMachineDeletedV1Beta2Reason, Message: "Machine deletionTimestamp set"}
15061506

15071507
tests := []struct {
15081508
name string
@@ -1550,7 +1550,7 @@ func TestSetRemediatingCondition(t *testing.T) {
15501550
Type: clusterv1.ClusterRemediatingV1Beta2Condition,
15511551
Status: metav1.ConditionTrue,
15521552
Reason: clusterv1.ClusterRemediatingV1Beta2Reason,
1553-
Message: "Remediation in progress from Machine m3",
1553+
Message: "Machine deletionTimestamp set from Machine m3",
15541554
},
15551555
},
15561556
{

‎internal/controllers/machinedeployment/machinedeployment_status_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ func Test_setRemediatingCondition(t *testing.T) {
884884
healthCheckSucceeded := clusterv1.Condition{Type: clusterv1.MachineHealthCheckSucceededV1Beta2Condition, Status: corev1.ConditionTrue}
885885
healthCheckNotSucceeded := clusterv1.Condition{Type: clusterv1.MachineHealthCheckSucceededV1Beta2Condition, Status: corev1.ConditionFalse}
886886
ownerRemediated := clusterv1.Condition{Type: clusterv1.MachineOwnerRemediatedCondition, Status: corev1.ConditionFalse}
887-
ownerRemediatedV1Beta2 := metav1.Condition{Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition, Status: metav1.ConditionFalse, Message: "Remediation in progress"}
887+
ownerRemediatedV1Beta2 := metav1.Condition{Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineSetMachineRemediationMachineDeletedV1Beta2Reason, Message: "Machine deletionTimestamp set"}
888888

889889
tests := []struct {
890890
name string
@@ -932,7 +932,7 @@ func Test_setRemediatingCondition(t *testing.T) {
932932
Type: clusterv1.MachineDeploymentRemediatingV1Beta2Condition,
933933
Status: metav1.ConditionTrue,
934934
Reason: clusterv1.MachineDeploymentRemediatingV1Beta2Reason,
935-
Message: "Remediation in progress from Machine m3",
935+
Message: "Machine deletionTimestamp set from Machine m3",
936936
},
937937
},
938938
{

‎internal/controllers/machinehealthcheck/machinehealthcheck_controller.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,10 @@ func (r *Reconciler) patchUnhealthyTargets(ctx context.Context, logger logr.Logg
477477

478478
if ownerRemediatedCondition := v1beta2conditions.Get(t.Machine, clusterv1.MachineOwnerRemediatedV1Beta2Condition); ownerRemediatedCondition == nil || ownerRemediatedCondition.Status == metav1.ConditionTrue {
479479
v1beta2conditions.Set(t.Machine, metav1.Condition{
480-
Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition,
481-
Status: metav1.ConditionFalse,
482-
Reason: clusterv1.MachineOwnerRemediatedWaitingForRemediationV1Beta2Reason,
480+
Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition,
481+
Status: metav1.ConditionFalse,
482+
Reason: clusterv1.MachineOwnerRemediatedWaitingForRemediationV1Beta2Reason,
483+
Message: "Waiting for remediation",
483484
})
484485
}
485486
}

‎internal/controllers/machineset/machineset_controller.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ type scope struct {
270270
infrastructureObjectNotFound bool
271271
getAndAdoptMachinesForMachineSetSucceeded bool
272272
owningMachineDeployment *clusterv1.MachineDeployment
273+
remediationPreflightCheckErrMessage string
274+
scaleUpPreflightCheckErrMessage string
273275
}
274276

275277
type machineSetReconcileFunc func(ctx context.Context, s *scope) (ctrl.Result, error)
@@ -602,6 +604,7 @@ func (r *Reconciler) syncReplicas(ctx context.Context, s *scope) (ctrl.Result, e
602604
// If the error is not nil use that as the message for the condition.
603605
preflightCheckErrMessage = err.Error()
604606
}
607+
s.scaleUpPreflightCheckErrMessage = preflightCheckErrMessage
605608
conditions.MarkFalse(ms, clusterv1.MachinesCreatedCondition, clusterv1.PreflightCheckFailedReason, clusterv1.ConditionSeverityError, preflightCheckErrMessage)
606609
return result, err
607610
}
@@ -1350,6 +1353,7 @@ func (r *Reconciler) reconcileUnhealthyMachines(ctx context.Context, s *scope) (
13501353
if preflightChecksFailed {
13511354
// PreflightChecks did not pass. Update the MachineOwnerRemediated condition on the unhealthy Machines with
13521355
// WaitingForRemediationReason reason.
1356+
s.remediationPreflightCheckErrMessage = preflightCheckErrMessage
13531357
if err := patchMachineConditions(ctx, r.Client, machinesToRemediate, metav1.Condition{
13541358
Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition,
13551359
Status: metav1.ConditionFalse,
@@ -1375,9 +1379,10 @@ func (r *Reconciler) reconcileUnhealthyMachines(ctx context.Context, s *scope) (
13751379
// Instead if we set the condition but the deletion does not go through on next reconcile either the
13761380
// condition will be fixed/updated or the Machine deletion will be retried.
13771381
if err := patchMachineConditions(ctx, r.Client, machinesToRemediate, metav1.Condition{
1378-
Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition,
1379-
Status: metav1.ConditionFalse,
1380-
Reason: clusterv1.MachineSetMachineRemediationMachineDeletedV1Beta2Reason,
1382+
Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition,
1383+
Status: metav1.ConditionFalse,
1384+
Reason: clusterv1.MachineSetMachineRemediationMachineDeletedV1Beta2Reason,
1385+
Message: "Machine deletionTimestamp set",
13811386
}, &clusterv1.Condition{
13821387
Type: clusterv1.MachineOwnerRemediatedCondition,
13831388
Status: corev1.ConditionTrue,

‎internal/controllers/machineset/machineset_controller_status.go

+19-10
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package machineset
1919
import (
2020
"context"
2121
"fmt"
22+
"slices"
2223
"sort"
2324
"strings"
2425
"time"
@@ -47,7 +48,7 @@ func (r *Reconciler) updateStatus(ctx context.Context, s *scope) {
4748
// Conditions
4849

4950
// Update the ScalingUp and ScalingDown condition.
50-
setScalingUpCondition(ctx, s.machineSet, s.machines, s.bootstrapObjectNotFound, s.infrastructureObjectNotFound, s.getAndAdoptMachinesForMachineSetSucceeded)
51+
setScalingUpCondition(ctx, s.machineSet, s.machines, s.bootstrapObjectNotFound, s.infrastructureObjectNotFound, s.getAndAdoptMachinesForMachineSetSucceeded, s.scaleUpPreflightCheckErrMessage)
5152
setScalingDownCondition(ctx, s.machineSet, s.machines, s.getAndAdoptMachinesForMachineSetSucceeded)
5253

5354
// MachinesReady condition: aggregate the Machine's Ready condition.
@@ -59,7 +60,7 @@ func (r *Reconciler) updateStatus(ctx context.Context, s *scope) {
5960
machines := collections.FromMachines(s.machines...)
6061
machinesToBeRemediated := machines.Filter(collections.IsUnhealthyAndOwnerRemediated)
6162
unhealthyMachines := machines.Filter(collections.IsUnhealthy)
62-
setRemediatingCondition(ctx, s.machineSet, machinesToBeRemediated, unhealthyMachines, s.getAndAdoptMachinesForMachineSetSucceeded)
63+
setRemediatingCondition(ctx, s.machineSet, machinesToBeRemediated, unhealthyMachines, s.getAndAdoptMachinesForMachineSetSucceeded, s.remediationPreflightCheckErrMessage)
6364

6465
setDeletingCondition(ctx, s.machineSet, s.machines, s.getAndAdoptMachinesForMachineSetSucceeded)
6566
}
@@ -92,7 +93,7 @@ func setReplicas(_ context.Context, ms *clusterv1.MachineSet, machines []*cluste
9293
ms.Status.V1Beta2.UpToDateReplicas = ptr.To(upToDateReplicas)
9394
}
9495

95-
func setScalingUpCondition(_ context.Context, ms *clusterv1.MachineSet, machines []*clusterv1.Machine, bootstrapObjectNotFound, infrastructureObjectNotFound, getAndAdoptMachinesForMachineSetSucceeded bool) {
96+
func setScalingUpCondition(_ context.Context, ms *clusterv1.MachineSet, machines []*clusterv1.Machine, bootstrapObjectNotFound, infrastructureObjectNotFound, getAndAdoptMachinesForMachineSetSucceeded bool, scaleUpPreflightCheckErrMessage string) {
9697
// If we got unexpected errors in listing the machines (this should never happen), surface them.
9798
if !getAndAdoptMachinesForMachineSetSucceeded {
9899
v1beta2conditions.Set(ms, metav1.Condition{
@@ -125,7 +126,7 @@ func setScalingUpCondition(_ context.Context, ms *clusterv1.MachineSet, machines
125126
if currentReplicas >= desiredReplicas {
126127
var message string
127128
if missingReferencesMessage != "" {
128-
message = fmt.Sprintf("Scaling up would be blocked %s", missingReferencesMessage)
129+
message = fmt.Sprintf("Scaling up would be blocked because %s", missingReferencesMessage)
129130
}
130131
v1beta2conditions.Set(ms, metav1.Condition{
131132
Type: clusterv1.MachineSetScalingUpV1Beta2Condition,
@@ -138,8 +139,11 @@ func setScalingUpCondition(_ context.Context, ms *clusterv1.MachineSet, machines
138139

139140
// Scaling up.
140141
message := fmt.Sprintf("Scaling up from %d to %d replicas", currentReplicas, desiredReplicas)
141-
if missingReferencesMessage != "" {
142-
message += fmt.Sprintf(" is blocked %s", missingReferencesMessage)
142+
if missingReferencesMessage != "" || scaleUpPreflightCheckErrMessage != "" {
143+
blockMessages := slices.DeleteFunc([]string{missingReferencesMessage, scaleUpPreflightCheckErrMessage}, func(s string) bool {
144+
return s == ""
145+
})
146+
message += fmt.Sprintf(" is blocked because %s", strings.Join(blockMessages, " and "))
143147
}
144148
v1beta2conditions.Set(ms, metav1.Condition{
145149
Type: clusterv1.MachineSetScalingUpV1Beta2Condition,
@@ -281,7 +285,7 @@ func setMachinesUpToDateCondition(ctx context.Context, machineSet *clusterv1.Mac
281285
v1beta2conditions.Set(machineSet, *upToDateCondition)
282286
}
283287

284-
func setRemediatingCondition(ctx context.Context, machineSet *clusterv1.MachineSet, machinesToBeRemediated, unhealthyMachines collections.Machines, getAndAdoptMachinesForMachineSetSucceeded bool) {
288+
func setRemediatingCondition(ctx context.Context, machineSet *clusterv1.MachineSet, machinesToBeRemediated, unhealthyMachines collections.Machines, getAndAdoptMachinesForMachineSetSucceeded bool, remediationPreflightCheckErrMessage string) {
285289
if !getAndAdoptMachinesForMachineSetSucceeded {
286290
v1beta2conditions.Set(machineSet, metav1.Condition{
287291
Type: clusterv1.MachineSetRemediatingV1Beta2Condition,
@@ -320,11 +324,16 @@ func setRemediatingCondition(ctx context.Context, machineSet *clusterv1.MachineS
320324
return
321325
}
322326

327+
msg := remediatingCondition.Message
328+
if remediationPreflightCheckErrMessage != "" {
329+
msg = fmt.Sprintf("Triggering further remediations is blocked because %s; %s", remediationPreflightCheckErrMessage, remediatingCondition.Message)
330+
}
331+
323332
v1beta2conditions.Set(machineSet, metav1.Condition{
324333
Type: remediatingCondition.Type,
325334
Status: metav1.ConditionTrue,
326335
Reason: clusterv1.MachineSetRemediatingV1Beta2Reason,
327-
Message: remediatingCondition.Message,
336+
Message: msg,
328337
})
329338
}
330339

@@ -383,10 +392,10 @@ func calculateMissingReferencesMessage(ms *clusterv1.MachineSet, bootstrapTempla
383392
}
384393

385394
if len(missingObjects) == 1 {
386-
return fmt.Sprintf("because %s does not exist", missingObjects[0])
395+
return fmt.Sprintf("%s does not exist", missingObjects[0])
387396
}
388397

389-
return fmt.Sprintf("because %s do not exist", strings.Join(missingObjects, " and "))
398+
return fmt.Sprintf("%s do not exist", strings.Join(missingObjects, " and "))
390399
}
391400

392401
func aggregateStaleMachines(machines []*clusterv1.Machine) string {

‎internal/controllers/machineset/machineset_controller_status_test.go

+48-4
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ func Test_setScalingUpCondition(t *testing.T) {
194194
bootstrapObjectNotFound bool
195195
infrastructureObjectNotFound bool
196196
getAndAdoptMachinesForMachineSetSucceeded bool
197+
scaleUpPreflightCheckErrMessage string
197198
expectCondition metav1.Condition
198199
}{
199200
{
@@ -299,6 +300,27 @@ func Test_setScalingUpCondition(t *testing.T) {
299300
Message: "Scaling up from 0 to 3 replicas is blocked because DockerMachineTemplate does not exist",
300301
},
301302
},
303+
{
304+
name: "scaling up and blocked by bootstrap and infrastructure object and preflight checks",
305+
ms: scalingUpMachineSetWith3Replicas,
306+
bootstrapObjectNotFound: true,
307+
infrastructureObjectNotFound: true,
308+
getAndAdoptMachinesForMachineSetSucceeded: true,
309+
// This preflight check error can happen when a MachineSet is scaling up while the control plane
310+
// already has a newer Kubernetes version.
311+
scaleUpPreflightCheckErrMessage: "MachineSet version (1.25.5) and ControlPlane version (1.26.2) " +
312+
"do not conform to kubeadm version skew policy as kubeadm only supports joining with the same " +
313+
"major+minor version as the control plane (\"KubeadmVersionSkew\" preflight check failed)",
314+
expectCondition: metav1.Condition{
315+
Type: clusterv1.MachineSetScalingUpV1Beta2Condition,
316+
Status: metav1.ConditionTrue,
317+
Reason: clusterv1.MachineSetScalingUpV1Beta2Reason,
318+
Message: "Scaling up from 0 to 3 replicas is blocked because KubeadmBootstrapTemplate and DockerMachineTemplate " +
319+
"do not exist and MachineSet version (1.25.5) and ControlPlane version (1.26.2) " +
320+
"do not conform to kubeadm version skew policy as kubeadm only supports joining with the same " +
321+
"major+minor version as the control plane (\"KubeadmVersionSkew\" preflight check failed)",
322+
},
323+
},
302324
{
303325
name: "deleting",
304326
ms: deletingMachineSetWith3Replicas,
@@ -317,7 +339,7 @@ func Test_setScalingUpCondition(t *testing.T) {
317339
t.Run(tt.name, func(t *testing.T) {
318340
g := NewWithT(t)
319341

320-
setScalingUpCondition(ctx, tt.ms, tt.machines, tt.bootstrapObjectNotFound, tt.infrastructureObjectNotFound, tt.getAndAdoptMachinesForMachineSetSucceeded)
342+
setScalingUpCondition(ctx, tt.ms, tt.machines, tt.bootstrapObjectNotFound, tt.infrastructureObjectNotFound, tt.getAndAdoptMachinesForMachineSetSucceeded, tt.scaleUpPreflightCheckErrMessage)
321343

322344
condition := v1beta2conditions.Get(tt.ms, clusterv1.MachineSetScalingUpV1Beta2Condition)
323345
g.Expect(condition).ToNot(BeNil())
@@ -758,13 +780,15 @@ func Test_setRemediatingCondition(t *testing.T) {
758780
healthCheckSucceeded := clusterv1.Condition{Type: clusterv1.MachineHealthCheckSucceededV1Beta2Condition, Status: corev1.ConditionTrue}
759781
healthCheckNotSucceeded := clusterv1.Condition{Type: clusterv1.MachineHealthCheckSucceededV1Beta2Condition, Status: corev1.ConditionFalse}
760782
ownerRemediated := clusterv1.Condition{Type: clusterv1.MachineOwnerRemediatedCondition, Status: corev1.ConditionFalse}
761-
ownerRemediatedV1Beta2 := metav1.Condition{Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition, Status: metav1.ConditionFalse, Message: "Remediation in progress"}
783+
ownerRemediatedV1Beta2 := metav1.Condition{Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineSetMachineRemediationMachineDeletedV1Beta2Reason, Message: "Machine deletionTimestamp set"}
784+
ownerRemediatedWaitingForRemediationV1Beta2 := metav1.Condition{Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineOwnerRemediatedWaitingForRemediationV1Beta2Reason, Message: "Waiting for remediation"}
762785

763786
tests := []struct {
764787
name string
765788
machineSet *clusterv1.MachineSet
766789
machines []*clusterv1.Machine
767790
getAndAdoptMachinesForMachineSetSucceeded bool
791+
remediationPreflightCheckErrMessage string
768792
expectCondition metav1.Condition
769793
}{
770794
{
@@ -806,7 +830,27 @@ func Test_setRemediatingCondition(t *testing.T) {
806830
Type: clusterv1.MachineSetRemediatingV1Beta2Condition,
807831
Status: metav1.ConditionTrue,
808832
Reason: clusterv1.MachineSetRemediatingV1Beta2Reason,
809-
Message: "Remediation in progress from Machine m3",
833+
Message: "Machine deletionTimestamp set from Machine m3",
834+
},
835+
},
836+
{
837+
name: "With machines to be remediated by MS and preflight check error",
838+
machineSet: &clusterv1.MachineSet{},
839+
machines: []*clusterv1.Machine{
840+
fakeMachine("m1", withConditions(healthCheckSucceeded)), // Healthy machine
841+
fakeMachine("m2", withConditions(healthCheckNotSucceeded)), // Unhealthy machine, not yet marked for remediation
842+
fakeMachine("m3", withConditions(healthCheckNotSucceeded, ownerRemediated), withV1Beta2Condition(ownerRemediatedV1Beta2)),
843+
fakeMachine("m4", withConditions(healthCheckNotSucceeded, ownerRemediated), withV1Beta2Condition(ownerRemediatedWaitingForRemediationV1Beta2)),
844+
},
845+
getAndAdoptMachinesForMachineSetSucceeded: true,
846+
// This preflight check error can happen when a Machine becomes unhealthy while the control plane is upgrading.
847+
remediationPreflightCheckErrMessage: "KubeadmControlPlane ns1/cp1 is upgrading (\"ControlPlaneIsStable\" preflight check failed)",
848+
expectCondition: metav1.Condition{
849+
Type: clusterv1.MachineSetRemediatingV1Beta2Condition,
850+
Status: metav1.ConditionTrue,
851+
Reason: clusterv1.MachineSetRemediatingV1Beta2Reason,
852+
Message: "Triggering further remediations is blocked because KubeadmControlPlane ns1/cp1 is upgrading (\"ControlPlaneIsStable\" preflight check failed); " +
853+
"Machine deletionTimestamp set from Machine m3; Waiting for remediation from Machine m4",
810854
},
811855
},
812856
{
@@ -852,7 +896,7 @@ func Test_setRemediatingCondition(t *testing.T) {
852896
machinesToBeRemediated = machines.Filter(collections.IsUnhealthyAndOwnerRemediated)
853897
unHealthyMachines = machines.Filter(collections.IsUnhealthy)
854898
}
855-
setRemediatingCondition(ctx, tt.machineSet, machinesToBeRemediated, unHealthyMachines, tt.getAndAdoptMachinesForMachineSetSucceeded)
899+
setRemediatingCondition(ctx, tt.machineSet, machinesToBeRemediated, unHealthyMachines, tt.getAndAdoptMachinesForMachineSetSucceeded, tt.remediationPreflightCheckErrMessage)
856900

857901
condition := v1beta2conditions.Get(tt.machineSet, clusterv1.MachineSetRemediatingV1Beta2Condition)
858902
g.Expect(condition).ToNot(BeNil())

0 commit comments

Comments
 (0)