k9s
k9s copied to clipboard
I get stuck in the dropdown menu when I try to delete a resource

Describe the bug
I want to delete my Deployment
with Propagation: Orphan
, but if I try to interact with the dropdown menu of the deletion popup, I get stuck in the dropdown and there's no way of confirming the deletion: the Enter
and the arrows just open the dropdown again. This happens also with deletion of single Pods
, ReplicaSet
, etc...
To Reproduce
- Create a dummy
Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: dummy-deployment
labels:
tier: frontend
spec:
replicas: 4
selector:
matchLabels:
tier: frontend
template:
metadata:
labels:
tier: frontend
spec:
containers:
- name: nginx-container
image: nginx:1.22-alpine
-
kubectl create -f dummy-deployment.yml
- Select the
dummy-deployment
in k9s -
ctrl+d
- Move up to the
Propagation
dropdown and pressEnter
- You're stuck :/
Expected behavior
After selecting the propagation method I expect to be able to move around the deletion popup and confirm the deletion of the Deployment
Versions (please complete the following information):
- OS:
$ system_profiler SPSoftwareDataType
Software:
System Software Overview:
System Version: macOS 12.5.1 (21G83)
Kernel Version: Darwin 21.6.0
Boot Volume: MAC
Boot Mode: Normal
Computer Name: Lorenzo’s MacBook Pro
User Name: Lorenzo Maffioli (lorenzo)
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 3 days 4:26
- K9s:
$ k9s version
Version: 0.26.3
Commit: 0893f13b3ca6b563dd0c38fdebaefdb8be594825
Date: n/a
- Kubectl:
$ eksctl info
eksctl version: 0.110.0-dev+b6664f852.2022-09-02T05:47:52Z
kubectl version: v1.25.0
OS: darwin
- K8s:
1.21
onEKS
Tab can get you out of the menu, but really enter should
Yep, tab
solved the problem. It's unintuitive since the arrows do the same thing, but not when you're inside the dropdown.
This behavior stems from the tview library, relevant code here: https://github.com/derailed/tview/blob/master/dropdown.go#L415. In essence Enter
, Down
, & normal chars open the dropdown - problematic when you expect Down
to navigate to a new field instead.
I've felt this was a little clunky & unintuitive before as well. Perhaps this issue would be better served under https://github.com/derailed/tview or the parent project https://github.com/rivo/tview.
@lorenzophys @caproven @pcmorrison Thank you all for piping in! I see your point and could probably address it in the fork. But this is really old school form navigation ie tab/backtab to move around form fields. So is it something we should compensate for and upgrade or can this behavior be learned??
I've adapted, and the behavior is consistent across tview applications so I think it is fine. Leaving it to @lorenzophys to give input as they opened this issue.
Maybe a note saying '<tab> to select' at the bottom of the menu?
@derailed I can easily get used to it, but if there was a note somewhere, as @pcmorrison suggested, it would probably save time to the next confused person.