fix: Respect --force flag for disk space checks

causing it to always run even with --force flag.

This is critical for NFS mounts with automatic capacity extension where
reported disk space is lower than actual available space.

Use case: Auto-extending NFS storage that shows limited capacity but
expands on demand.
This commit is contained in:
2025-11-29 10:42:26 +00:00
parent 82dcafbad1
commit 730ff5795a

View File

@@ -500,10 +500,10 @@ func runRestoreCluster(cmd *cobra.Command, args []string) error {
}
}
log.Warn("⚠️ Using alternative working directory for extraction")
log.Warn(" This is recommended when system disk space is limited")
log.Warn(" Location: " + restoreWorkdir)
}
log.Warn("⚠️ Using alternative working directory for extraction")
log.Warn(" This is recommended when system disk space is limited")
log.Warn(" Location: " + restoreWorkdir)
}
log.Info("Checking disk space...")
multiplier := 4.0 // Cluster needs more space for extraction
@@ -515,9 +515,7 @@ func runRestoreCluster(cmd *cobra.Command, args []string) error {
if err := safety.VerifyTools("postgres"); err != nil {
return fmt.Errorf("tool verification failed: %w", err)
}
}
// Create database instance for pre-checks
} // Create database instance for pre-checks
db, err := database.New(cfg, log)
if err != nil {
return fmt.Errorf("failed to create database instance: %w", err)