k9s
k9s copied to clipboard
Add a persistent popup for drain failures

Is your feature request related to a problem? Please describe.
Implement a persistent drain popup on error. During a drain in k9s, if the drain fails, the toast at the bottom isn't quite enough to notify people of what's happened. It goes away quickly and is sometimes hard to see the error message. I'm usually left exiting k9s and just running a kubectl drain ...
.
Describe the solution you'd like I'm envisioning a simple solution to start like:
This would also open up the possibility for a progress dialog or with a context of "it's taking a while to drain..." that could solve https://github.com/derailed/k9s/issues/237#issuecomment-592061481
Describe alternatives you've considered
The alternative is to leave it how it is which is fine, but it's bit several team members to the point where I've just told them to use kubectl drain ...
instead.
Additional context I'm working on a PR to add the dialog as stated above with a configuration option (default disabled for backward compatability) as I'm sure some folks out there may not like an extra pop-up.
@FernFerret I see can see the impetus for this as the flash is indeed short lived when an error occurred. First impressions:
- We must be consistent with this behavior for all error conditions occurring in k9s
- The dialog must visually pop a bit more imho
- Sounds great, I'll see what I can do.
- Absolutely, I just threw this together to see how it felt, I'll get the styling shored up a bit as well as the layout
Thanks for the feedback, I'll put together a rev 2 of this one and then can make sure it looks good with other error dialogs.
@derailed I'm still actually interested in this as it bites me, I'll try to get some work done on it at some point for your review.
Expanding on this a little..
Performing drain in k9s seems to block, probably waiting on the API server. If I try to drain multiple nodes in quick succession then k9s appears to freeze (although it is still responsive to resizing of the terminal). If I wait several minutes then it recovers, but if instead I try pressing ESC or ^C then nothing immediately happens (it is as if the entire terminal has crashed).
So initiating a drain should pop up a window that both:
- indicates that the process has commenced and k9s is trying to do something (and reaffirming what options were submitted).
- contains the output messages (evictions, or inability to remove pods), and lingers until the window is dismissed by the user.
(This also interacts with #1788, in that it is confusing to debug drain problems if the messages are not properly made visible.)