Skip to content

Commit 9656771

Browse files
More comments
1 parent 145c050 commit 9656771

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

api/v1beta1/machine_types.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ const (
228228
// machine has been deleted while the Machine is still running.
229229
MachineHealthCheckNodeDeletedV1Beta2Reason = "NodeDeleted"
230230

231-
// MachineHealthCheckHasRemediateMachineAnnotationV1Beta2Reason surfaces a MachineHealthCheck detects a machine manually remediated
231+
// MachineHealthCheckHasRemediateAnnotationV1Beta2Reason surfaces a MachineHealthCheck detects a machine manually remediated
232232
// via the remediate-machine annotation.
233-
MachineHealthCheckHasRemediateMachineAnnotationV1Beta2Reason = "HasRemediateAnnotation"
233+
MachineHealthCheckHasRemediateAnnotationV1Beta2Reason = "HasRemediateAnnotation"
234234
)
235235

236236
// Machine's OwnerRemediated conditions and corresponding reasons that will be used in v1Beta2 API version.
@@ -241,9 +241,9 @@ const (
241241
// determine that the controller owning this machine should perform remediation.
242242
MachineOwnerRemediatedV1Beta2Condition = "OwnerRemediated"
243243

244-
// MachineOwnerRemediatedWaitingForOwnerRemediationV1Beta2Reason surfaces the machine is waiting for the owner controller
244+
// MachineOwnerRemediatedWaitingForRemediationV1Beta2Reason surfaces the machine is waiting for the owner controller
245245
// to start remediation.
246-
MachineOwnerRemediatedWaitingForOwnerRemediationV1Beta2Reason = "WaitingForRemediation"
246+
MachineOwnerRemediatedWaitingForRemediationV1Beta2Reason = "WaitingForRemediation"
247247
)
248248

249249
// Machine's ExternallyRemediated conditions and corresponding reasons that will be used in v1Beta2 API version.
@@ -254,17 +254,17 @@ const (
254254
// determine that an external controller should perform remediation.
255255
MachineExternallyRemediatedV1Beta2Condition = "ExternallyRemediated"
256256

257-
// MachineExternallyRemediatedWaitingForExternalRemediationV1Beta2Reason surfaces the machine is waiting for the
257+
// MachineExternallyRemediatedWaitingForRemediationV1Beta2Reason surfaces the machine is waiting for the
258258
// external remediation controller to start remediation.
259-
MachineExternallyRemediatedWaitingForExternalRemediationV1Beta2Reason = "WaitingForRemediation"
259+
MachineExternallyRemediatedWaitingForRemediationV1Beta2Reason = "WaitingForRemediation"
260260

261-
// MachineExternallyRemediatedTemplateNotFoundV1Beta2Reason surfaces that the MachineHealthCheck cannot
261+
// MachineExternallyRemediatedRemediationTemplateNotFoundV1Beta2Reason surfaces that the MachineHealthCheck cannot
262262
// find the template for a external remediation request.
263-
MachineExternallyRemediatedTemplateNotFoundV1Beta2Reason = "RemediationTemplateNotFound"
263+
MachineExternallyRemediatedRemediationTemplateNotFoundV1Beta2Reason = "RemediationTemplateNotFound"
264264

265-
// MachineExternallyRemediatedRequestCreationFailedV1Beta2Reason surfaces that the MachineHealthCheck cannot
265+
// MachineExternallyRemediatedRemediationRequestCreationFailedV1Beta2Reason surfaces that the MachineHealthCheck cannot
266266
// create a request for the external remediation controller.
267-
MachineExternallyRemediatedRequestCreationFailedV1Beta2Reason = "RemediationRequestCreationFailed"
267+
MachineExternallyRemediatedRemediationRequestCreationFailedV1Beta2Reason = "RemediationRequestCreationFailed"
268268
)
269269

270270
// Machine's Deleting condition and corresponding reasons that will be used in v1Beta2 API version.

internal/controllers/machinehealthcheck/machinehealthcheck_controller.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ func (r *Reconciler) patchUnhealthyTargets(ctx context.Context, logger logr.Logg
417417
v1beta2conditions.Set(t.Machine, metav1.Condition{
418418
Type: clusterv1.MachineExternallyRemediatedV1Beta2Condition,
419419
Status: metav1.ConditionFalse,
420-
Reason: clusterv1.MachineExternallyRemediatedTemplateNotFoundV1Beta2Reason,
420+
Reason: clusterv1.MachineExternallyRemediatedRemediationTemplateNotFoundV1Beta2Reason,
421421
Message: fmt.Sprintf("error retrieving remediation template %s %s", m.Spec.RemediationTemplate.Kind, klog.KRef(t.Machine.Namespace, m.Spec.RemediationTemplate.Name)),
422422
})
423423
errList = append(errList, errors.Wrapf(err, "error retrieving remediation template %v %q for machine %q in namespace %q within cluster %q", m.Spec.RemediationTemplate.GroupVersionKind(), m.Spec.RemediationTemplate.Name, t.Machine.Name, t.Machine.Namespace, m.Spec.ClusterName))
@@ -453,8 +453,8 @@ func (r *Reconciler) patchUnhealthyTargets(ctx context.Context, logger logr.Logg
453453
v1beta2conditions.Set(t.Machine, metav1.Condition{
454454
Type: clusterv1.MachineExternallyRemediatedV1Beta2Condition,
455455
Status: metav1.ConditionFalse,
456-
Reason: clusterv1.MachineExternallyRemediatedRequestCreationFailedV1Beta2Reason,
457-
Message: "take a look at the controller logs",
456+
Reason: clusterv1.MachineExternallyRemediatedRemediationRequestCreationFailedV1Beta2Reason,
457+
Message: "Please check controller logs for errors",
458458
})
459459
errList = append(errList, errors.Wrapf(err, "error creating remediation request for machine %q in namespace %q within cluster %q", t.Machine.Name, t.Machine.Namespace, t.Machine.Spec.ClusterName))
460460
return errList
@@ -463,7 +463,7 @@ func (r *Reconciler) patchUnhealthyTargets(ctx context.Context, logger logr.Logg
463463
v1beta2conditions.Set(t.Machine, metav1.Condition{
464464
Type: clusterv1.MachineExternallyRemediatedV1Beta2Condition,
465465
Status: metav1.ConditionFalse,
466-
Reason: clusterv1.MachineExternallyRemediatedWaitingForExternalRemediationV1Beta2Reason,
466+
Reason: clusterv1.MachineExternallyRemediatedWaitingForRemediationV1Beta2Reason,
467467
})
468468
} else {
469469
logger.Info("Target has failed health check, marking for remediation", "target", t.string(), "reason", condition.Reason, "message", condition.Message)
@@ -477,7 +477,7 @@ func (r *Reconciler) patchUnhealthyTargets(ctx context.Context, logger logr.Logg
477477
v1beta2conditions.Set(t.Machine, metav1.Condition{
478478
Type: clusterv1.MachineOwnerRemediatedV1Beta2Condition,
479479
Status: metav1.ConditionFalse,
480-
Reason: clusterv1.MachineOwnerRemediatedWaitingForOwnerRemediationV1Beta2Reason,
480+
Reason: clusterv1.MachineOwnerRemediatedWaitingForRemediationV1Beta2Reason,
481481
})
482482
}
483483
}

internal/controllers/machinehealthcheck/machinehealthcheck_targets.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (t *healthCheckTarget) needsRemediation(logger logr.Logger, timeoutForMachi
102102
v1beta2conditions.Set(t.Machine, metav1.Condition{
103103
Type: clusterv1.MachineHealthCheckSucceededV1Beta2Condition,
104104
Status: metav1.ConditionFalse,
105-
Reason: clusterv1.MachineHealthCheckHasRemediateMachineAnnotationV1Beta2Reason,
105+
Reason: clusterv1.MachineHealthCheckHasRemediateAnnotationV1Beta2Reason,
106106
Message: "Marked for remediation via cluster.x-k8s.io/remediate-machine annotation",
107107
})
108108
return true, time.Duration(0)

internal/controllers/machinehealthcheck/machinehealthcheck_targets_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func TestHealthCheckTargets(t *testing.T) {
421421
Node: nil,
422422
}
423423
machineAnnotationRemediationCondition := newFailedHealthCheckCondition(clusterv1.HasRemediateMachineAnnotationReason, annotationRemediationMsg)
424-
machineAnnotationRemediationV1Beta2Condition := newFailedHealthCheckV1Beta2Condition(clusterv1.MachineHealthCheckHasRemediateMachineAnnotationV1Beta2Reason, annotationRemediationV1Beta2Msg)
424+
machineAnnotationRemediationV1Beta2Condition := newFailedHealthCheckV1Beta2Condition(clusterv1.MachineHealthCheckHasRemediateAnnotationV1Beta2Reason, annotationRemediationV1Beta2Msg)
425425

426426
testCases := []struct {
427427
desc string

0 commit comments

Comments
 (0)