Skip to content

Commit

Permalink
Just set the faliure if the err code is 400
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaja Omer committed Oct 16, 2024
1 parent 15cc858 commit f4fc2e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controller/linodemachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (r *LinodeMachineReconciler) reconcile(ctx context.Context, logger logr.Log
defer func() {
if err != nil {
// Only set failure reason if the error is not retryable.
if !util.IsRetryableError(err) {
if linodego.ErrHasStatus(err, http.StatusBadRequest) {
machineScope.LinodeMachine.Status.FailureReason = util.Pointer(failureReason)
machineScope.LinodeMachine.Status.FailureMessage = util.Pointer(err.Error())
conditions.MarkFalse(machineScope.LinodeMachine, clusterv1.ReadyCondition, string(failureReason), clusterv1.ConditionSeverityError, "%s", err.Error())

Check warning on line 181 in controller/linodemachine_controller.go

View check run for this annotation

Codecov / codecov/patch

controller/linodemachine_controller.go#L179-L181

Added lines #L179 - L181 were not covered by tests
Expand Down

0 comments on commit f4fc2e2

Please sign in to comment.