fix: prevent -Force -Cleanup with -Version filter

Force cleanup wipes all Terraform state, so filtering by version
would leave an inconsistent state where subsequent provisions fail.
Error early with a clear message instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-25 14:39:27 -05:00
parent 8c6790476b
commit a27863f4ef
+4 -1
View File
@@ -266,7 +266,10 @@ if ($Integration) {
if ($Cleanup) {
Start-InfraContainer
if ($Force) {
docker exec $InfraContainer bash $RunIntegration force-cleanup $Version
if ($Version -ne 'all') {
throw "-Force cannot be combined with -Version. Force cleanup destroys all resources and wipes Terraform state."
}
docker exec $InfraContainer bash $RunIntegration force-cleanup
} else {
docker exec $InfraContainer bash $RunIntegration cleanup $Version
}