From 89469db3a97e765821fb7783e84ba9c5b1e7ee8d Mon Sep 17 00:00:00 2001 From: Alexander Maslennikov Date: Wed, 13 Nov 2024 11:21:46 +0100 Subject: [PATCH] fix: Set device status to PendingReboot if needed after spec validation Signed-off-by: Alexander Maslennikov --- internal/controller/nicdevice_controller.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/controller/nicdevice_controller.go b/internal/controller/nicdevice_controller.go index 34dc534..b17d745 100644 --- a/internal/controller/nicdevice_controller.go +++ b/internal/controller/nicdevice_controller.go @@ -496,6 +496,13 @@ func (r *NicDeviceReconciler) handleSpecValidation(ctx context.Context, statuses status.nvConfigUpdateRequired = false status.rebootRequired = false status.lastStageError = errors.New(consts.FwConfigNotAppliedAfterRebootErrorMsg) + default: + // If reboot hasn't happened yet, proceed as normal and set PendingReboot status + log.Log.V(2).Info("reboot pending for device", "device", status.device.Name) + err = r.updateDeviceStatusCondition(ctx, status.device, consts.PendingRebootReason, metav1.ConditionTrue, "") + if err != nil { + status.lastStageError = err + } } } }(i)