Skip to content

Commit a27d3b1

Browse files
committed
Machine should not be considered healthy until it has a node
1 parent 6386ed1 commit a27d3b1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

controllers/machinehealthcheck_targets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func (r *MachineHealthCheckReconciler) healthCheckTargets(targets []healthCheckT
301301
continue
302302
}
303303

304-
if t.Machine.DeletionTimestamp.IsZero() {
304+
if t.Machine.DeletionTimestamp.IsZero() && t.Node != nil {
305305
conditions.MarkTrue(t.Machine, clusterv1.MachineHealthCheckSuccededCondition)
306306
healthy = append(healthy, t)
307307
}

controllers/machinehealthcheck_targets_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@ func TestHealthCheckTargets(t *testing.T) {
373373
desc: "when the node has not started for a long time but the startup timeout is disabled",
374374
targets: []healthCheckTarget{nodeNotYetStartedTarget400s},
375375
timeoutForMachineToHaveNode: &disabledTimeoutForMachineToHaveNode,
376-
expectedHealthy: []healthCheckTarget{},
376+
expectedHealthy: []healthCheckTarget{}, // The node is not healthy as it does not have a machine
377377
expectedNeedsRemediation: []healthCheckTarget{},
378-
expectedNextCheckTimes: []time.Duration{1 * time.Minute},
378+
expectedNextCheckTimes: []time.Duration{}, // We don't have a timeout so no way to know when to re-check
379379
},
380380
}
381381

0 commit comments

Comments
 (0)