Skip to content

Commit

Permalink
fix: report fatal sequence errors as reboots
Browse files Browse the repository at this point in the history
When the sequence fails hard, Talos does automatic reboot, so reflect
this in the machine status properly.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
(cherry picked from commit 29020cb)
  • Loading branch information
smira committed Jan 11, 2023
1 parent a2f7901 commit c6fb80a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

k8sadapter "github.com/siderolabs/talos/internal/app/machined/pkg/adapters/k8s"
v1alpha1runtime "github.com/siderolabs/talos/internal/app/machined/pkg/runtime"
"github.com/siderolabs/talos/pkg/machinery/api/common"
machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine"
"github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1/machine"
"github.com/siderolabs/talos/pkg/machinery/resources/config"
Expand Down Expand Up @@ -361,6 +362,10 @@ func (ctrl *MachineStatusController) watchEvents() {
newStage = runtime.MachineStageRebooting
}
case machineapi.SequenceEvent_NOOP:
if event.Error != nil && event.Error.Code == common.Code_FATAL {
// fatal errors lead to reboot
newStage = runtime.MachineStageRebooting
}
case machineapi.SequenceEvent_STOP:
if event.Sequence == v1alpha1runtime.SequenceBoot.String() && event.Error == nil {
newStage = runtime.MachineStageRunning
Expand Down

0 comments on commit c6fb80a

Please sign in to comment.