Skip to content

Swallow SIGINT while running kubectl#380

Merged
bboston7 merged 1 commit intostellar:mainfrom
drebelsky:allow-kubectl-sigint
Apr 29, 2026
Merged

Swallow SIGINT while running kubectl#380
bboston7 merged 1 commit intostellar:mainfrom
drebelsky:allow-kubectl-sigint

Conversation

@drebelsky
Copy link
Copy Markdown
Contributor

Sometimes I realize that my local network is set up wrong such that the authentication flow can't complete. While it is possible to just wait the minute for the pre-existing code to detect this, I'd prefer to be able to just CTRL+C cancel the kubectl auth whoami that does the token refresh. Before this PR, CTRL+C would also stop the running F# code, so we wouldn't run the command that attempts to restore the original id-token.

Copilot AI review requested due to automatic review settings April 28, 2026 21:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts ConnectToCluster’s internal kubectl invocation so Ctrl+C during kubectl auth whoami cancels kubectl without terminating the parent F# process, allowing the code to proceed to restoring the original id-token when refresh fails.

Changes:

  • Temporarily installs a Console.CancelKeyPress handler while kubectl is running to swallow Ctrl+C in the parent process.
  • Ensures the handler is removed via try/finally after kubectl completes or times out.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/FSLibrary/StellarSupercluster.fs
@bboston7 bboston7 force-pushed the allow-kubectl-sigint branch from 0389da9 to 1dec98d Compare April 29, 2026 22:38
@bboston7 bboston7 merged commit a19ce86 into stellar:main Apr 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants