Suspend/Resume on CronJobs ignores marked rows (Trigger honors them)
Describe the bug
In the CronJob view I can mark several rows with Space. Trigger (t) and delete act on all marked rows, but Suspend/Resume (s) only acts on the row under the cursor and silently ignores the marks.
To Reproduce
- Create a few CronJobs:
kubectl create cronjob cj-a --image=busybox --schedule="*/5 * * * *" -- date, and the same forcj-b. - In k9s, go to
:cronjobs. - Mark
cj-aandcj-bwithSpace. - Press
t. The dialog says "Trigger 2 CronJobs?". - Cancel, then press
s. The dialog only lists the cursor row (default/cj-b). - Confirm. Only
cj-bis suspended (kubectl get cronjobshowscj-astillFalse).
Expected behavior
s acts on all marked rows, like t. It would show "Suspend 2 CronJobs" or "Resume 2 CronJobs".
Additional context
The code path is toggleSuspendCmd in internal/view/cronjob.go. It uses GetSelectedItem() while triggerCmd uses GetSelectedItems(), even though both are registered in the same aa.Bulk(...) block.
I have a working fix. For a mixed selection (some suspended, some not) I chose "resume only if all are suspended, otherwise suspend all". Happy to change that if you'd prefer different semantics, and I can open a PR if you're fine with the direction.
Versions
- OS: Ubuntu 26.04 (WSL2)
- K9s: built from master (9ef1901)
- K8s: v1.36.4+k3s1 (k3s)
Source: derailed/k9s