Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FIX (agent): Make pgType param mandatory over restore

Rostislav Dugine2ac5bfbd769
diff --git a/agent/cmd/main.go b/agent/cmd/main.go
index d79b6eb5..9367da29 100644
--- a/agent/cmd/main.go
+++ b/agent/cmd/main.go
@@ -144,6 +144,11 @@ func runRestore(args []string) {
os.Exit(1)
}
+ if cfg.PgType != "host" && cfg.PgType != "docker" {
+ fmt.Fprintf(os.Stderr, "Error: --pg-type must be 'host' or 'docker', got '%s'\n", cfg.PgType)
+ os.Exit(1)
+ }
+
apiClient := api.NewClient(cfg.DatabasusHost, cfg.Token, log)
restorer := restore.NewRestorer(apiClient, log, *pgDataDir, *backupID, *targetTime, cfg.PgType)