feat: recover interrupted installation preparation safely
This commit is contained in:
@@ -52,6 +52,11 @@ type journal struct {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
func (r Result) NeedsReview() bool {
|
||||
return (r.WorkspacePreparation != nil && r.WorkspacePreparation.Code == "schema_review_required") ||
|
||||
(r.BindingImport != nil && r.BindingImport.Code == "schema_review_required")
|
||||
}
|
||||
|
||||
// Check must repeat document validation and live prerequisite probes at the public CLI boundary.
|
||||
// It is mandatory; historical success in the plan never authorizes skipping current checks.
|
||||
type Check func(context.Context, preflight.Plan) error
|
||||
@@ -255,7 +260,7 @@ func Run(ctx context.Context, request Request, runner compose.Runner, check Chec
|
||||
// A journal entry alone is never proof that a container or migration still exists.
|
||||
for _, stage := range stages {
|
||||
if err := operation(stage.name, stage.run); err != nil {
|
||||
if result.WorkspacePreparation != nil && result.WorkspacePreparation.Code == "schema_review_required" {
|
||||
if result.NeedsReview() {
|
||||
return fail(stage.name, "Review the pending schema synchronization in application Administration, then repeat apply. No destructive change was confirmed by the installer.")
|
||||
}
|
||||
return fail(stage.name, err.Error())
|
||||
|
||||
Reference in New Issue
Block a user