Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/FSLibrary/StellarSupercluster.fs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,20 @@ let ConnectToCluster (cfgFile: string) (nsOpt: string option) : (Kubernetes * st
with :? ComponentModel.Win32Exception -> false

if started then
if proc.WaitForExit(TimeSpan(0, 1, 0)) then
if proc.ExitCode = 0 then RanSuccess else RanWithError proc.ExitCode
else
proc.Kill()
DidNotComplete(proc.WaitForExit(TimeSpan(0, 1, 0)))
// Swallow Ctrl+C in the parent while kubectl is running, so the
// SIGINT delivered to the foreground process group only stops
// kubectl and lets us decide what to do next.
let cancelHandler = ConsoleCancelEventHandler(fun _ e -> e.Cancel <- true)
Console.CancelKeyPress.AddHandler cancelHandler

try
if proc.WaitForExit(TimeSpan(0, 1, 0)) then
if proc.ExitCode = 0 then RanSuccess else RanWithError proc.ExitCode
else
proc.Kill()
DidNotComplete(proc.WaitForExit(TimeSpan(0, 1, 0)))
Comment thread
drebelsky marked this conversation as resolved.
finally
Console.CancelKeyPress.RemoveHandler cancelHandler
else
DidNotRun)

Expand Down
Loading