Skip to content

Commit

Permalink
Merge pull request #226 from justinsb/down_shut_down_if_should_not_sh…
Browse files Browse the repository at this point in the history
…ut_down

Don't shut down on control-C, if we should not shut down
  • Loading branch information
k8s-ci-robot authored Nov 14, 2022
2 parents d306c41 + 355b19b commit 9829a3f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 9829a3f

Please sign in to comment.