k9s icon indicating copy to clipboard operation
k9s copied to clipboard

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

Open lorenzophys opened this issue 2 years ago • 2 comments




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

  1. 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
  1. kubectl create -f dummy-deployment.yml
  2. Select the dummy-deployment in k9s
  3. ctrl+d
  4. Move up to the Propagation dropdown and press Enter
  5. 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 on EKS

lorenzophys avatar Sep 03 '22 21:09 lorenzophys

Tab can get you out of the menu, but really enter should

pcmorrison avatar Sep 12 '22 08:09 pcmorrison

Yep, tab solved the problem. It's unintuitive since the arrows do the same thing, but not when you're inside the dropdown.

lorenzophys avatar Sep 15 '22 20:09 lorenzophys

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.

caproven avatar Sep 24 '22 16:09 caproven

@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??

derailed avatar Sep 26 '22 14:09 derailed

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.

caproven avatar Sep 27 '22 01:09 caproven

Maybe a note saying '<tab> to select' at the bottom of the menu?

pcmorrison avatar Sep 27 '22 08:09 pcmorrison

@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.

lorenzophys avatar Sep 28 '22 06:09 lorenzophys