fix: report fatal sequence errors as reboots
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>
This commit is contained in:
parent
96629d5ba6
commit
29020cb9c7
@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
k8sadapter "github.com/siderolabs/talos/internal/app/machined/pkg/adapters/k8s"
|
k8sadapter "github.com/siderolabs/talos/internal/app/machined/pkg/adapters/k8s"
|
||||||
v1alpha1runtime "github.com/siderolabs/talos/internal/app/machined/pkg/runtime"
|
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"
|
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/config/types/v1alpha1/machine"
|
||||||
"github.com/siderolabs/talos/pkg/machinery/resources/config"
|
"github.com/siderolabs/talos/pkg/machinery/resources/config"
|
||||||
@ -363,6 +364,10 @@ func (ctrl *MachineStatusController) watchEvents() {
|
|||||||
newStage = runtime.MachineStageRebooting
|
newStage = runtime.MachineStageRebooting
|
||||||
}
|
}
|
||||||
case machineapi.SequenceEvent_NOOP:
|
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:
|
case machineapi.SequenceEvent_STOP:
|
||||||
if event.Sequence == v1alpha1runtime.SequenceBoot.String() && event.Error == nil {
|
if event.Sequence == v1alpha1runtime.SequenceBoot.String() && event.Error == nil {
|
||||||
newStage = runtime.MachineStageRunning
|
newStage = runtime.MachineStageRunning
|
||||||
|
Loading…
x
Reference in New Issue
Block a user