Skip to content

Commit 3c37ca2

Browse files
authored
Rel v0.50.16 (#3633)
* fix #3620 - bomb on show yaml * fix #3595 - namespace warp * fix #3608 - klog logger * fix #3621 #3576 * fix #3629 - bump scanner deps * rel notes
1 parent 26ab3fc commit 3c37ca2

File tree

18 files changed

+483
-314
lines changed

18 files changed

+483
-314
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME := k9s
2-
VERSION ?= v0.50.15
2+
VERSION ?= v0.50.16
33
PACKAGE := github.com/derailed/$(NAME)
44
OUTPUT_BIN ?= execs/${NAME}
55
GO_FLAGS ?=

change_logs/release_v0.50.16.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<img src="https://github.com/derailed/k9s/master/assets/k9s.png" align="center" width="800" height="auto"/>
2+
3+
# Release v0.50.16
4+
5+
## Notes
6+
7+
Thank you to all that contributed with flushing out issues and enhancements for K9s!
8+
I'll try to mark some of these issues as fixed. But if you don't mind grab the latest rev
9+
and see if we're happier with some of the fixes!
10+
If you've filed an issue please help me verify and close.
11+
12+
Your support, kindness and awesome suggestions to make K9s better are, as ever, very much noted and appreciated!
13+
Also big thanks to all that have allocated their own time to help others on both slack and on this repo!!
14+
15+
As you may know, K9s is not pimped out by big corporations with deep pockets, thus if you feel K9s is helping in your Kubernetes journey, please consider joining our [sponsorship program](https://github.com/sponsors/derailed) and/or make some noise on social! [@kitesurfer](https://twitter.com/kitesurfer)
16+
17+
On Slack? Please join us [K9slackers](https://join.slack.com/t/k9sers/shared_invite/zt-3360a389v-ElLHrb0Dp1kAXqYUItSAFA)
18+
19+
## Maintenance Release!
20+
21+
Sponsorships are dropping at an alarming rate which puts this project in the red. This is becoming a concern and sad not to mention unsustainable ;( If you dig `k9s` and want to help the project, please consider `paying it forward!` and don't become just another `satisfied, non paying customer!`. K9s does take a lot of my `free` time to maintain, enhance and keep the light on. Many cool ideas are making it straight to the `freezer` as I just can't budget them in.
22+
I know many of you work for big corporations, so please put in the word/work and have them help us out via sponsorships or other means.
23+
24+
Thank you!
25+
26+
### Warp Speed Scotty!
27+
28+
As of this drop, we are introducing `namespace warp` via shortcut `w`.
29+
This affords to view all resources of that type based on the currently selected resource namespace.
30+
This command is only available on namespaced resources.
31+
For example, if you are in pod view and select pod-xxx in namespace `bozo`, hitting `w` will `warp`
32+
you to view all pods in namespace `bozo`.
33+
34+
## Resolved Issues
35+
36+
* [#3629](https://github.com/derailed/k9s/issues/3629) vulnerability in k9s project
37+
* [#3621](https://github.com/derailed/k9s/issues/3621) Switching to ":Deploy" sends you to deployments from namespace "deploy"
38+
* [#3620](https://github.com/derailed/k9s/issues/3620) Trying to show pod yaml using custom views.yaml crashes k9s
39+
* [#3608](https://github.com/derailed/k9s/issues/3608) k9s crashes when :namespaces used
40+
* [#3601](https://github.com/derailed/k9s/issues/3601) Can't delete namespace
41+
* [#3595](https://github.com/derailed/k9s/issues/3595) Toggle Namespace Filter in Pods View with 'n' Key
42+
* [#3576](https://github.com/derailed/k9s/issues/3576) Custom alias/view not working anymore since v0.50.10
43+
44+
---
45+
46+
## Contributed PRs
47+
48+
Please be sure to give `Big Thanks!` and `ATTA Girls/Boys!` to all the fine contributors for making K9s better for all of us!!
49+
50+
* [#3625](https://github.com/derailed/k9s/pull/3625) fix: debug-container plugin when KUBECONFIG has multiple files
51+
* [#3623](https://github.com/derailed/k9s/pull/3623) bugfix: fix panic in BenchmarkPodRender by using NewPod() constructor
52+
* [#3619](https://github.com/derailed/k9s/pull/3619) feat: plugin to list all resources by namespace
53+
* [#3605](https://github.com/derailed/k9s/pull/3605) browser: do not prevent redraw when connection unavailable
54+
* [#3600](https://github.com/derailed/k9s/pull/3600) fix(shell): set linux when OS detection fails
55+
* [#3588](https://github.com/derailed/k9s/pull/3588) fix: do not error out of shellIn if OS detection fails
56+
57+
58+
---
59+
<img src="https://github.com/derailed/k9s/master/assets/imhotep_logo.png" width="32" height="auto"/> © 2025 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)#

go.mod

Lines changed: 96 additions & 93 deletions
Large diffs are not rendered by default.

go.sum

Lines changed: 213 additions & 204 deletions
Large diffs are not rendered by default.

internal/client/gvr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func NewGVR(s string) *GVR {
8383
return &gvr
8484
}
8585

86-
func (g *GVR) IsCommand() bool {
86+
func (g *GVR) IsAlias() bool {
8787
return !g.IsK8sRes()
8888
}
8989

internal/config/alias.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ func (a *Aliases) Resolve(p *cmd.Interpreter) (*client.GVR, bool) {
8989
}
9090

9191
if gvr.IsK8sRes() {
92-
p.Reset(strings.Replace(p.GetLine(), p.Cmd(), gvr.String(), 1), gvr.String())
92+
p.Reset(strings.Replace(p.GetLine(), p.Cmd(), gvr.String(), 1), p.Cmd())
9393
return gvr, true
9494
}
9595

96-
for gvr.IsCommand() {
96+
for gvr.IsAlias() {
9797
ap := cmd.NewInterpreter(gvr.String())
9898
gvr, ok = a.Get(ap.Cmd())
9999
if !ok {

internal/model/history.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
package model
55

66
import (
7+
"log/slog"
78
"strings"
9+
10+
"github.com/derailed/k9s/internal/slogs"
11+
"github.com/derailed/k9s/internal/view/cmd"
812
)
913

1014
// MaxHistory tracks max command history.
@@ -37,6 +41,21 @@ func (h *History) Top() (string, bool) {
3741
return h.at(h.currentIdx)
3842
}
3943

44+
func (h *History) SwitchNS(ns string) {
45+
c, ok := h.Top()
46+
if !ok {
47+
return
48+
}
49+
i := cmd.NewInterpreter(c)
50+
i.SwitchNS(ns)
51+
line := i.GetLine()
52+
if _, ok := i.NSArg(); ok && line != c {
53+
h.Push(line)
54+
slog.Debug("History (switch-ns)", slogs.Stack, strings.Join(h.List(), "|"))
55+
return
56+
}
57+
}
58+
4059
// Last returns the nth command prior to last.
4160
func (h *History) Last(idx int) (string, bool) {
4261
h.currentIdx = len(h.commands) - idx
@@ -97,6 +116,10 @@ func (h *History) Push(c string) {
97116
if c == "" || len(h.commands) >= h.limit {
98117
return
99118
}
119+
if t, ok := h.Top(); ok && t == c {
120+
return
121+
}
122+
100123
if h.currentIdx < len(h.commands)-1 {
101124
h.commands = h.commands[:h.currentIdx+1]
102125
}

internal/render/pod.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (p *Pod) Render(o any, _ string, row *model1.Row) error {
140140
if p.specs.isEmpty() {
141141
return nil
142142
}
143-
cols, err := p.specs.realize(pwm.Raw, defaultPodHeader, row)
143+
cols, err := p.specs.realize(pwm.Raw.DeepCopy(), defaultPodHeader, row)
144144
if err != nil {
145145
return err
146146
}

internal/view/app.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ func (*App) stopImgScanner() {
145145
}
146146
}
147147

148+
func (a *App) clearHistory() {
149+
a.cmdHistory.Clear()
150+
a.filterHistory.Clear()
151+
}
152+
148153
func (a *App) initImgScanner(version string) {
149154
defer func(t time.Time) {
150155
slog.Debug("Scanner init time", slogs.Elapsed, time.Since(t))

internal/view/browser.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/derailed/k9s/internal/view/cmd"
2727
"github.com/derailed/tcell/v2"
2828
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
29+
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2930
"k8s.io/apimachinery/pkg/labels"
3031
"k8s.io/apimachinery/pkg/util/sets"
3132
)
@@ -364,6 +365,25 @@ func (b *Browser) TableLoadFailed(err error) {
364365
// ----------------------------------------------------------------------------
365366
// Actions...
366367

368+
func (b *Browser) nsWarpCmd(*tcell.EventKey) *tcell.EventKey {
369+
path := b.GetTable().GetSelectedItem()
370+
if path == "" {
371+
return nil
372+
}
373+
374+
o, err := b.app.factory.Get(b.GVR(), path, true, nil)
375+
if err != nil {
376+
return nil
377+
}
378+
u, ok := o.(*unstructured.Unstructured)
379+
if !ok {
380+
return nil
381+
}
382+
b.App().gotoResource(b.GVR().String()+" "+u.GetNamespace(), "", true, true)
383+
384+
return nil
385+
}
386+
367387
func (b *Browser) viewCmd(evt *tcell.EventKey) *tcell.EventKey {
368388
path := b.GetSelectedItem()
369389
if path == "" {
@@ -500,7 +520,7 @@ func editRes(app *App, gvr *client.GVR, path string) error {
500520
ns = client.BlankNamespace
501521
}
502522
if gvr == client.NsGVR {
503-
ns = n
523+
n = ns
504524
}
505525
if ok, err := app.Conn().CanI(ns, gvr, n, client.PatchAccess); !ok || err != nil {
506526
return fmt.Errorf("current user can't edit resource %s", gvr)
@@ -641,6 +661,9 @@ func (b *Browser) namespaceActions(aa *ui.KeyActions) {
641661
return
642662
}
643663
aa.Add(ui.KeyN, ui.NewKeyAction("Copy Namespace", b.cpNsCmd, false))
664+
if b.meta.Namespaced {
665+
aa.Add(ui.KeyW, ui.NewKeyAction("Warp To Namespace", b.nsWarpCmd, true))
666+
}
644667

645668
b.namespaces = make(map[int]string, data.MaxFavoritesNS)
646669
var index int

0 commit comments

Comments
 (0)