Skip to content

Commit 70b94f2

Browse files
authored
Merge branch 'master' into add-configurable-emoji
2 parents 82f3475 + 582cca3 commit 70b94f2

File tree

7 files changed

+32
-27
lines changed

7 files changed

+32
-27
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Binaries for Linux, Windows and Mac are available as tarballs in the [release pa
117117
* On Ubuntu
118118

119119
```shell
120-
wget https://github.com/derailed/k9s/releases/download/v0.32.7/k9s_linux_amd64.deb && apt install ./k9s_linux_amd64.deb && rm k9s_linux_amd64.deb
120+
wget https://github.com/derailed/k9s/releases/latest/download/k9s_linux_amd64.deb && apt install ./k9s_linux_amd64.deb && rm k9s_linux_amd64.deb
121121
```
122122

123123
* Via [Winget](https://github.com/microsoft/winget-cli) for Windows

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ require (
2929
golang.org/x/text v0.22.0
3030
gopkg.in/yaml.v2 v2.4.0
3131
gopkg.in/yaml.v3 v3.0.1
32-
helm.sh/helm/v3 v3.17.0
32+
helm.sh/helm/v3 v3.17.1
3333
k8s.io/api v0.32.2
3434
k8s.io/apiextensions-apiserver v0.32.2
3535
k8s.io/apimachinery v0.32.2
3636
k8s.io/cli-runtime v0.32.2
3737
k8s.io/client-go v0.32.2
3838
k8s.io/klog/v2 v2.130.1
39-
k8s.io/kubectl v0.32.1
39+
k8s.io/kubectl v0.32.2
4040
k8s.io/metrics v0.32.2
4141
sigs.k8s.io/yaml v1.4.0
4242
)

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -1885,8 +1885,8 @@ gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8=
18851885
gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
18861886
gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
18871887
gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g=
1888-
helm.sh/helm/v3 v3.17.0 h1:DUD4AGdNVn7PSTYfxe1gmQG7s18QeWv/4jI9TubnhT0=
1889-
helm.sh/helm/v3 v3.17.0/go.mod h1:Mo7eGyKPPHlS0Ml67W8z/lbkox/gD9Xt1XpD6bxvZZA=
1888+
helm.sh/helm/v3 v3.17.1 h1:gzVoAD+qVuoJU6KDMSAeo0xRJ6N1znRxz3wyuXRmJDk=
1889+
helm.sh/helm/v3 v3.17.1/go.mod h1:nvreuhuR+j78NkQcLC3TYoprCKStLyw5P4T7E5itv2w=
18901890
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
18911891
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
18921892
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
@@ -1912,8 +1912,8 @@ k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
19121912
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
19131913
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=
19141914
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
1915-
k8s.io/kubectl v0.32.1 h1:/btLtXLQUU1rWx8AEvX9jrb9LaI6yeezt3sFALhB8M8=
1916-
k8s.io/kubectl v0.32.1/go.mod h1:sezNuyWi1STk4ZNPVRIFfgjqMI6XMf+oCVLjZen/pFQ=
1915+
k8s.io/kubectl v0.32.2 h1:TAkag6+XfSBgkqK9I7ZvwtF0WVtUAvK8ZqTt+5zi1Us=
1916+
k8s.io/kubectl v0.32.2/go.mod h1:+h/NQFSPxiDZYX/WZaWw9fwYezGLISP0ud8nQKg+3g8=
19171917
k8s.io/metrics v0.32.2 h1:7t/rZzTHFrGa9f94XcgLlm3ToAuJtdlHANcJEHlYl9g=
19181918
k8s.io/metrics v0.32.2/go.mod h1:VL3nJpzcgB6L5nSljkkzoE0nilZhVgcjCfNRgoylaIQ=
19191919
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=

internal/ui/app.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@ func (a *App) StylesChanged(s *config.Styles) {
123123
a.Main.SetBackgroundColor(s.BgColor())
124124
if f, ok := a.Main.GetPrimitive("main").(*tview.Flex); ok {
125125
f.SetBackgroundColor(s.BgColor())
126-
if h, ok := f.ItemAt(0).(*tview.Flex); ok {
127-
h.SetBackgroundColor(s.BgColor())
128-
} else {
129-
log.Error().Msgf("Header not found")
126+
if !a.Config.K9s.IsHeadless() {
127+
if h, ok := f.ItemAt(0).(*tview.Flex); ok {
128+
h.SetBackgroundColor(s.BgColor())
129+
} else {
130+
log.Error().Msgf("Header not found")
131+
}
130132
}
131133
} else {
132134
log.Error().Msgf("Main not found")

internal/view/app.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ func (a *App) cowCmd(msg string) {
645645
dialog.ShowError(a.Styles.Dialog(), a.Content.Pages, msg)
646646
}
647647

648-
func (a *App) dirCmd(path string) error {
648+
func (a *App) dirCmd(path string, pushCmd bool) error {
649649
log.Debug().Msgf("DIR PATH %q", path)
650650
_, err := os.Stat(path)
651651
if err != nil {
@@ -657,7 +657,9 @@ func (a *App) dirCmd(path string) error {
657657
path = dir
658658
}
659659
}
660-
a.cmdHistory.Push("dir " + path)
660+
if pushCmd {
661+
a.cmdHistory.Push("dir " + path)
662+
}
661663

662664
return a.inject(NewDir(path), true)
663665
}

internal/view/cmd/types.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ var (
4747
"help": {},
4848
}
4949
aliasCmd = map[string]struct{}{
50-
"a": {},
51-
"alias": {},
50+
"a": {},
51+
"alias": {},
52+
"aliases": {},
5253
}
5354
xrayCmd = map[string]struct{}{
5455
"x": {},

internal/view/command.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func allowedXRay(gvr client.GVR) bool {
8484
return ok
8585
}
8686

87-
func (c *Command) contextCmd(p *cmd.Interpreter) error {
87+
func (c *Command) contextCmd(p *cmd.Interpreter, pushCmd bool) error {
8888
ct, ok := p.ContextArg()
8989
if !ok {
9090
return fmt.Errorf("invalid command use `context xxx`")
@@ -99,7 +99,7 @@ func (c *Command) contextCmd(p *cmd.Interpreter) error {
9999
return err
100100
}
101101

102-
return c.exec(p, gvr, c.componentFor(gvr, ct, v), true, true)
102+
return c.exec(p, gvr, c.componentFor(gvr, ct, v), true, pushCmd)
103103
}
104104

105105
func (c *Command) namespaceCmd(p *cmd.Interpreter) bool {
@@ -115,17 +115,17 @@ func (c *Command) namespaceCmd(p *cmd.Interpreter) bool {
115115
return false
116116
}
117117

118-
func (c *Command) aliasCmd(p *cmd.Interpreter) error {
118+
func (c *Command) aliasCmd(p *cmd.Interpreter, pushCmd bool) error {
119119
filter, _ := p.FilterArg()
120120

121121
gvr := client.NewGVR("aliases")
122122
v := NewAlias(gvr)
123123
v.SetFilter(filter)
124124

125-
return c.exec(p, gvr, v, false, true)
125+
return c.exec(p, gvr, v, false, pushCmd)
126126
}
127127

128-
func (c *Command) xrayCmd(p *cmd.Interpreter) error {
128+
func (c *Command) xrayCmd(p *cmd.Interpreter, pushCmd bool) error {
129129
arg, cns, ok := p.XrayArgs()
130130
if !ok {
131131
return errors.New("invalid command. use `xray xxx`")
@@ -148,12 +148,12 @@ func (c *Command) xrayCmd(p *cmd.Interpreter) error {
148148
return err
149149
}
150150

151-
return c.exec(p, client.NewGVR("xrays"), NewXray(gvr), true, true)
151+
return c.exec(p, client.NewGVR("xrays"), NewXray(gvr), true, pushCmd)
152152
}
153153

154154
// Run execs the command by showing associated display.
155155
func (c *Command) run(p *cmd.Interpreter, fqn string, clearStack bool, pushCmd bool) error {
156-
if c.specialCmd(p) {
156+
if c.specialCmd(p, pushCmd) {
157157
return nil
158158
}
159159
gvr, v, err := c.viewMetaFor(p)
@@ -233,7 +233,7 @@ func (c *Command) defaultCmd(isRoot bool) error {
233233
return nil
234234
}
235235

236-
func (c *Command) specialCmd(p *cmd.Interpreter) bool {
236+
func (c *Command) specialCmd(p *cmd.Interpreter, pushCmd bool) bool {
237237
switch {
238238
case p.IsCowCmd():
239239
if msg, ok := p.CowArg(); !ok {
@@ -246,11 +246,11 @@ func (c *Command) specialCmd(p *cmd.Interpreter) bool {
246246
case p.IsHelpCmd():
247247
_ = c.app.helpCmd(nil)
248248
case p.IsAliasCmd():
249-
if err := c.aliasCmd(p); err != nil {
249+
if err := c.aliasCmd(p, pushCmd); err != nil {
250250
c.app.Flash().Err(err)
251251
}
252252
case p.IsXrayCmd():
253-
if err := c.xrayCmd(p); err != nil {
253+
if err := c.xrayCmd(p, pushCmd); err != nil {
254254
c.app.Flash().Err(err)
255255
}
256256
case p.IsRBACCmd():
@@ -260,15 +260,15 @@ func (c *Command) specialCmd(p *cmd.Interpreter) bool {
260260
c.app.Flash().Err(err)
261261
}
262262
case p.IsContextCmd():
263-
if err := c.contextCmd(p); err != nil {
263+
if err := c.contextCmd(p, pushCmd); err != nil {
264264
c.app.Flash().Err(err)
265265
}
266266
case p.IsNamespaceCmd():
267267
return c.namespaceCmd(p)
268268
case p.IsDirCmd():
269269
if a, ok := p.DirArg(); !ok {
270270
c.app.Flash().Errf("Invalid command. Use `dir xxx`")
271-
} else if err := c.app.dirCmd(a); err != nil {
271+
} else if err := c.app.dirCmd(a, pushCmd); err != nil {
272272
c.app.Flash().Err(err)
273273
}
274274
default:

0 commit comments

Comments
 (0)