fix: finalize durable Pi lifecycle
This commit is contained in:
@@ -189,7 +189,7 @@ func piCommand(ctx context.Context, installation config.Installation, runner com
|
||||
fmt.Fprintf(stdout, "Pi defaults applied and read back. Provider credentials remain only in the host file %s (mode 0600). Never pass credentials to thothctl.\n", authFile)
|
||||
return 0
|
||||
case "update":
|
||||
request, err := parsePiUpdateArgs(args[1:], filepath.Join(installation.ProjectDirectory, ".thothctl", "update-state.json"))
|
||||
request, err := parsePiUpdateArgs(args[1:], installation.UpdateStatePath())
|
||||
if err != nil {
|
||||
return commandUsageError(stderr, err.Error())
|
||||
}
|
||||
@@ -207,7 +207,7 @@ func piCommand(ctx context.Context, installation config.Installation, runner com
|
||||
if len(args) != 2 || args[1] != "--yes" {
|
||||
return commandUsageError(stderr, "pi rollback requires --yes")
|
||||
}
|
||||
result, err := pi.Rollback(ctx, controlled, filepath.Join(installation.ProjectDirectory, ".thothctl", "update-state.json"), true)
|
||||
result, err := pi.Rollback(ctx, controlled, installation.UpdateStatePath(), true)
|
||||
if err != nil {
|
||||
return piFailure(stderr, err, secretValues)
|
||||
}
|
||||
@@ -223,7 +223,7 @@ func piCommand(ctx context.Context, installation config.Installation, runner com
|
||||
return 0
|
||||
}
|
||||
if len(args) == 3 && args[1] == "recover" && args[2] == "--yes" {
|
||||
statePath := filepath.Join(installation.ProjectDirectory, ".thothctl", "update-state.json")
|
||||
statePath := installation.UpdateStatePath()
|
||||
if err := pi.RecoverMaintenance(ctx, controlled, statePath, true); err != nil {
|
||||
return piFailure(stderr, err, secretValues)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user