From 20e82e21ef3da43a121a203c89714b0431f7fd82 Mon Sep 17 00:00:00 2001 From: zjhe Date: Fri, 13 Jan 2023 19:45:47 +0800 Subject: [PATCH] try destroy without refresh first to avoid invalid tf code blocking destroy --- e2etest.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2etest.go b/e2etest.go index 51f3b82..1032b3d 100644 --- a/e2etest.go +++ b/e2etest.go @@ -34,9 +34,9 @@ func destroy(t *testing.T, option terraform.Options) { option.RetryableTerraformErrors = map[string]string{ ".*": "Retry destroy on any error", } - _, err := terraform.DestroyE(t, &option) + _, err := terraform.RunTerraformCommandE(t, &option, terraform.FormatArgs(&option, "destroy", "-auto-approve", "-input=false", "-refresh=false")...) if err != nil { - _, err = terraform.RunTerraformCommandE(t, &option, terraform.FormatArgs(&option, "destroy", "-auto-approve", "-input=false", "-refresh=false")...) + _, err = terraform.DestroyE(t, &option) } require.NoError(t, err) }