Closed adamwg closed 4 months ago
Question: with this change, do we still need the signal handler we set up in main.go
? All it does is call os.Exit
(via kongCtx.Exit
), and looking at git history I suspect it was introduced to work around the fact that pterm was intercepting our signals.
Question: with this change, do we still need the signal handler we set up in main.go? All it does is call os.Exit (via kongCtx.Exit), and looking at git history I suspect it was introduced to work around the fact that pterm was intercepting our signals.
My guess is no, but it should be easy enough to test your changes with the up space init
flow to double check.
Confirmed that with our signal handler removed up space init
can still be stopped with Ctrl-C. Added a commit to remove our signal handler, since it's not necessary.
Description of your changes
In older versions, the pterm library we use for pretty-printing intercepted SIGINT and SIGTERM. This signal handling was set up in the pacakge's
init
function, so any code that ran before we set up our own signal handler couldn't be killed with Ctrl-C.The signal handling was removed from pterm in a more recent version (see [1]). Updating to the latest fixes the issue where we couldn't kill
up login
with Ctrl-C (#526).[1] https://github.com/pterm/pterm/issues/562
Fixes #526
Signed-off-by: Adam Wolfe Gordon adam.wolfegordon@upbound.io
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.How has this code been tested
up login
can be killed with Ctrl-C at either theUsername
or thePassword
prompt, with or without entering input first.make test
to ensure the dependency update didn't break any unit tests.up ctx
,up ctp list
,up space list
) to validate that output still looks right.