From 5c3af808a528d4a871208a2b68659f2850215bb0 Mon Sep 17 00:00:00 2001 From: EKS Distro PR Bot <75336432+eks-distro-pr-bot@users.noreply.github.com> Date: Thu, 31 Oct 2024 12:35:25 -0400 Subject: [PATCH] Skip cleaning up the instance if cleanup-resources is set to false (#8935) Co-authored-by: Vignesh Goutham Ganesh --- internal/test/e2e/run.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/test/e2e/run.go b/internal/test/e2e/run.go index 569bd5bb1bf4..c5d2d752b4df 100644 --- a/internal/test/e2e/run.go +++ b/internal/test/e2e/run.go @@ -249,9 +249,13 @@ func RunTests(conf instanceRunConf, inventoryCatalogue map[string]*hardwareCatal conf.Logger.Info("TestRunner instance has been created") defer func() { - err := testRunner.decommInstance(conf) - if err != nil { - conf.Logger.V(1).Info("WARN: Failed to decomm e2e test runner instance", "error", err) + if conf.CleanupResources { + err := testRunner.decommInstance(conf) + if err != nil { + conf.Logger.V(1).Info("WARN: Failed to decomm e2e test runner instance", "error", err) + } + } else { + conf.Logger.V(1).Info("Skipping to terminate instance. cleanup-resources set to false") } }()