recovery: honor canceled datastore preflight

This commit is contained in:
codex 2026-10-03 02:17:44 -05:00
parent e9d95c3bd6
commit bbcf285514
2 changed files with 6 additions and 0 deletions

View File

@ -135,6 +135,10 @@ func isTimeSynced(raw string) bool {
// Signature: (o *Orchestrator) preflightExternalDatastore(ctx context.Context) error.
// Why: keeps behavior explicit so startup/shutdown workflows remain maintainable as services evolve.
func (o *Orchestrator) preflightExternalDatastore(ctx context.Context) error {
// Cancellation must win even when a local datastore is already reachable.
if err := ctx.Err(); err != nil {
return err
}
if len(o.cfg.ControlPlanes) == 0 {
return nil
}

View File

@ -359,6 +359,8 @@ func TestHookVaultLifecycleBranchMatrix(t *testing.T) {
cfgFail.Startup.RequireFluxHealth = false
cfgFail.Startup.RequireWorkloadConvergence = false
cfgFail.Startup.RequireCriticalServiceEndpoints = true
cfgFail.Startup.CriticalServiceEndpointWaitSec = 1
cfgFail.Startup.CriticalServiceEndpointPollSec = 1
run := func(ctx context.Context, timeout time.Duration, name string, args ...string) (string, error) {
command := name + " " + strings.Join(args, " ")
if name == "kubectl" && strings.Contains(command, "get endpoints") {