From 355b19b86284eeaf2079c6a2cc801c8e7d066dbd Mon Sep 17 00:00:00 2001 From: Justin SB Date: Sun, 13 Nov 2022 20:38:57 -0500 Subject: [PATCH] Don't shut down on control-C, if we should not shut down If the user has asked us not to shut down the cluster, don't shut it down if they control-C out of long running tests. Allows for iterative test debugging etc. --- pkg/app/app.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index 862b0f9a..774bf574 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -97,9 +97,11 @@ func RealMain(opts types.Options, d types.Deployer, tester types.Tester) (result select { case <-c: if opts.ShouldUp() || opts.ShouldTest() { - klog.Info("Captured ^C, gracefully attempting to cleanup resources..") - if err := writer.WrapStep("Down", d.Down); err != nil { - result = err + if opts.ShouldDown() { + klog.Info("Captured ^C, gracefully attempting to cleanup resources..") + if err := writer.WrapStep("Down", d.Down); err != nil { + result = err + } } os.Exit(0) }