From a27863f4efd727bc285d7f2c71ececa6c058650f Mon Sep 17 00:00:00 2001 From: Clint Branham Date: Wed, 25 Mar 2026 14:39:27 -0500 Subject: [PATCH] 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) --- tests/dev.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/dev.ps1 b/tests/dev.ps1 index 19cfa32..e8e743f 100644 --- a/tests/dev.ps1 +++ b/tests/dev.ps1 @@ -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 }