@@ -86,7 +86,7 @@ func (t *healthCheckTarget) nodeName() string {
8686// If the target doesn't currently need rememdiation, provide a duration after
8787// which the target should next be checked.
8888// The target should be requeued after this duration.
89- func (t * healthCheckTarget ) needsRemediation (logger logr.Logger , timeoutForMachineToHaveNode time .Duration ) (bool , time.Duration ) {
89+ func (t * healthCheckTarget ) needsRemediation (logger logr.Logger , timeoutForMachineToHaveNode metav1 .Duration ) (bool , time.Duration ) {
9090 var nextCheckTimes []time.Duration
9191 now := time .Now ()
9292
@@ -146,14 +146,14 @@ func (t *healthCheckTarget) needsRemediation(logger logr.Logger, timeoutForMachi
146146 }
147147 logger .V (3 ).Info ("Using comparison time" , "time" , comparisonTime )
148148
149- if comparisonTime .Add (timeoutForMachineToHaveNode ).Before (now ) {
149+ if comparisonTime .Add (timeoutForMachineToHaveNode . Duration ).Before (now ) {
150150 conditions .MarkFalse (t .Machine , clusterv1 .MachineHealthCheckSuccededCondition , clusterv1 .NodeStartupTimeoutReason , clusterv1 .ConditionSeverityWarning , "Node failed to report startup in %s" , timeoutForMachineToHaveNode .String ())
151151 logger .V (3 ).Info ("Target is unhealthy: machine has no node" , "duration" , timeoutForMachineToHaveNode .String ())
152152 return true , time .Duration (0 )
153153 }
154154
155155 durationUnhealthy := now .Sub (comparisonTime )
156- nextCheck := timeoutForMachineToHaveNode - durationUnhealthy + time .Second
156+ nextCheck := timeoutForMachineToHaveNode . Duration - durationUnhealthy + time .Second
157157
158158 return false , nextCheck
159159 }
@@ -272,7 +272,7 @@ func (r *MachineHealthCheckReconciler) getNodeFromMachine(ctx context.Context, c
272272
273273// healthCheckTargets health checks a slice of targets
274274// and gives a data to measure the average health.
275- func (r * MachineHealthCheckReconciler ) healthCheckTargets (targets []healthCheckTarget , logger logr.Logger , timeoutForMachineToHaveNode time .Duration ) ([]healthCheckTarget , []healthCheckTarget , []time.Duration ) {
275+ func (r * MachineHealthCheckReconciler ) healthCheckTargets (targets []healthCheckTarget , logger logr.Logger , timeoutForMachineToHaveNode metav1 .Duration ) ([]healthCheckTarget , []healthCheckTarget , []time.Duration ) {
276276 var nextCheckTimes []time.Duration
277277 var unhealthy []healthCheckTarget
278278 var healthy []healthCheckTarget
0 commit comments