Skip to content

Commit

Permalink
Prevent cleanup on CTRL-C (#1769)
Browse files Browse the repository at this point in the history
* Prevent cleanup on CTRL-C

* adjusting log message

* Update cmd/deploy.go

Co-authored-by: Roman Dodin <[email protected]>

---------

Co-authored-by: Roman Dodin <[email protected]>
  • Loading branch information
steiler and hellt authored Dec 5, 2023
1 parent 8d388f5 commit 6cbbc43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,11 @@ func setupCTRLCHandler(cancel context.CancelFunc) {
signal.Notify(sig, os.Interrupt, syscall.SIGTERM)
go func() {
<-sig
log.Errorf("Caught CTRL-C. Stopping deployment and cleaning up!")
log.Errorf("Caught CTRL-C. Stopping deployment!")
cancel()

// when interrupted, destroy the interrupted lab deployment with cleanup
cleanup = true
// when interrupted, destroy the interrupted lab deployment
cleanup = false
if err := destroyFn(destroyCmd, []string{}); err != nil {
log.Errorf("Failed to destroy lab: %v", err)
}
Expand Down

0 comments on commit 6cbbc43

Please sign in to comment.