Skip to content

Commit af44091

Browse files
committed
fix: avoid panic in config loading/validation
As wrong `error` value was used, publishing an event was causing a panic in Talos. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
1 parent 4b8e9de commit af44091

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ func LoadConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFu
429429

430430
if e != nil {
431431
r.Events().Publish(&machineapi.ConfigLoadErrorEvent{
432-
Error: err.Error(),
432+
Error: e.Error(),
433433
})
434434

435435
return e
@@ -440,7 +440,7 @@ func LoadConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFu
440440
cfg, e := r.LoadAndValidateConfig(b)
441441
if e != nil {
442442
r.Events().Publish(&machineapi.ConfigLoadErrorEvent{
443-
Error: err.Error(),
443+
Error: e.Error(),
444444
})
445445

446446
return e

0 commit comments

Comments
 (0)