hecate: always clear startup intent on exit
This commit is contained in:
parent
6717cd1f3e
commit
ed7568d44d
@ -100,10 +100,12 @@ func (o *Orchestrator) Startup(ctx context.Context, opts StartupOptions) (err er
|
|||||||
return fmt.Errorf("set startup intent: %w", writeErr)
|
return fmt.Errorf("set startup intent: %w", writeErr)
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if err == nil {
|
finalReason := opts.Reason
|
||||||
if writeErr := state.MustWriteIntent(o.cfg.State.IntentPath, state.IntentNormal, opts.Reason, "startup"); writeErr != nil {
|
if err != nil {
|
||||||
o.log.Printf("warning: write startup completion intent failed: %v", writeErr)
|
finalReason = fmt.Sprintf("%s (failed)", strings.TrimSpace(opts.Reason))
|
||||||
}
|
}
|
||||||
|
if writeErr := state.MustWriteIntent(o.cfg.State.IntentPath, state.IntentNormal, finalReason, "startup"); writeErr != nil {
|
||||||
|
o.log.Printf("warning: write startup completion intent failed: %v", writeErr)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user