Skip to content

Commit d6f18c4

Browse files
author
Yuvaraj Kakaraparthi
committed
fix
1 parent baf0219 commit d6f18c4

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

controlplane/kubeadm/api/v1alpha4/conversion.go

+2
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ func (src *KubeadmControlPlaneTemplate) ConvertTo(dstRaw conversion.Hub) error {
141141
dst.Spec.Template.Spec.MachineTemplate.NodeDeletionTimeout = restored.Spec.Template.Spec.MachineTemplate.NodeDeletionTimeout
142142
}
143143

144+
dst.Spec.Template.Spec.RolloutIfCertificatesExpireWithinMinutes = restored.Spec.Template.Spec.RolloutIfCertificatesExpireWithinMinutes
145+
144146
return nil
145147
}
146148

internal/controllers/machinehealthcheck/machinehealthcheck_targets_test.go

+1-20
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ func TestHealthCheckTargets(t *testing.T) {
210210

211211
timeoutForMachineToHaveNode := 10 * time.Minute
212212
disabledTimeoutForMachineToHaveNode := time.Duration(0)
213-
214-
twoDaysFromNow := time.Now().Add(time.Hour * 24 * 2)
213+
timeoutForUnhealthyConditions := 5 * time.Minute
215214

216215
// Create a test MHC
217216
testMHC := &clusterv1.MachineHealthCheck{
@@ -241,9 +240,6 @@ func TestHealthCheckTargets(t *testing.T) {
241240

242241
testMachine := newTestMachine("machine1", namespace, clusterName, "node1", mhcSelector)
243242

244-
testMachineWithExpiringCertificate := testMachine.DeepCopy()
245-
testMachineWithExpiringCertificate.Status.CertificatesExpiryDate = &metav1.Time{Time: twoDaysFromNow}
246-
247243
// Targets for when the node has not yet been seen by the Machine controller
248244
testMachineCreated1200s := testMachine.DeepCopy()
249245
nowMinus1200s := metav1.NewTime(time.Now().Add(-1200 * time.Second))
@@ -344,14 +340,6 @@ func TestHealthCheckTargets(t *testing.T) {
344340
}
345341
machineFailureMsgCondition := newFailedHealthCheckCondition(clusterv1.MachineHasFailureReason, "FailureMessage: %s", failureMsg)
346342

347-
machineCertExpiringTarget := healthCheckTarget{
348-
Cluster: cluster,
349-
MHC: testMHC,
350-
Machine: testMachineWithExpiringCertificate,
351-
Node: testNodeHealthy,
352-
nodeMissing: false,
353-
}
354-
355343
testCases := []struct {
356344
desc string
357345
targets []healthCheckTarget
@@ -438,13 +426,6 @@ func TestHealthCheckTargets(t *testing.T) {
438426
expectedNeedsRemediationCondition: []clusterv1.Condition{machineFailureMsgCondition},
439427
expectedNextCheckTimes: []time.Duration{},
440428
},
441-
{
442-
desc: "when a machines certificates are not valid for longer than the minimum expiry duration",
443-
targets: []healthCheckTarget{machineCertExpiringTarget},
444-
expectedHealthy: []healthCheckTarget{},
445-
expectedNeedsRemediation: []healthCheckTarget{machineCertExpiringTarget},
446-
expectedNextCheckTimes: []time.Duration{},
447-
},
448429
}
449430

450431
for _, tc := range testCases {

0 commit comments

Comments
 (0)