hecate: auto-clear stale startup intent on lock
This commit is contained in:
parent
ba76e81ec2
commit
75ad091898
@ -107,6 +107,13 @@ func (o *Orchestrator) Startup(ctx context.Context, opts StartupOptions) (err er
|
||||
if readErr != nil {
|
||||
return fmt.Errorf("read startup intent: %w", readErr)
|
||||
}
|
||||
if currentIntent.State == state.IntentStartupInProgress {
|
||||
o.log.Printf("warning: detected stale startup intent from a previous interrupted run; clearing it before continuing")
|
||||
if clearErr := state.MustWriteIntent(o.cfg.State.IntentPath, state.IntentNormal, "auto-clear stale startup intent", "startup"); clearErr != nil {
|
||||
return fmt.Errorf("clear stale startup intent: %w", clearErr)
|
||||
}
|
||||
currentIntent = state.Intent{State: state.IntentNormal}
|
||||
}
|
||||
if currentIntent.State == state.IntentShuttingDown {
|
||||
return fmt.Errorf("startup blocked: shutdown intent is active (%s)", currentIntent.Reason)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user