Skip to content

Commit 356c561

Browse files
authored
K9s/release v0.31.4 (#2464)
* [Bug] Fix scale dialog ui * [bug] Fix #2463 * v0.31.4 release notes
1 parent 942e61a commit 356c561

File tree

8 files changed

+76
-21
lines changed

8 files changed

+76
-21
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DATE ?= $(shell TZ=UTC date -j -f "%s" ${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:
1111
else
1212
DATE ?= $(shell date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ")
1313
endif
14-
VERSION ?= v0.31.3
14+
VERSION ?= v0.31.4
1515
IMG_NAME := derailed/k9s
1616
IMAGE := ${IMG_NAME}:${VERSION}
1717

change_logs/release_v0.31.4.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/k9s.png" align="center" width="800" height="auto"/>
2+
3+
# Release v0.31.4
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 corps with deep pockets, thus if you feel K9s is helping your Kubernetes journey,
16+
please consider joining our [sponsorship program](https://github.com/sponsors/derailed) and/or make some noise on social! [@kitesurfer](https://twitter.com/kitesurfer)
17+
18+
On Slack? Please join us [K9slackers](https://join.slack.com/t/k9sers/shared_invite/enQtOTA5MDEyNzI5MTU0LWQ1ZGI3MzliYzZhZWEyNzYxYzA3NjE0YTk1YmFmNzViZjIyNzhkZGI0MmJjYzhlNjdlMGJhYzE2ZGU1NjkyNTM)
19+
20+
## Maintenance Release!
21+
22+
More aftermath...
23+
24+
Thank you all for pitching in and helping flesh out issues!!
25+
26+
Please make sure to add gory details to issues ie relevant configs, debug logs, etc...
27+
28+
Comments like: `same here!` or `me to!` doesn't really help us zero in.
29+
Everyone has slightly different settings/platforms so every little bits of info helps with the resolves.
30+
Thank you!!
31+
32+
---
33+
34+
## Videos Are In The Can!
35+
36+
Please dial [K9s Channel](https://www.youtube.com/channel/UC897uwPygni4QIjkPCpgjmw) for up coming content...
37+
38+
* [K9s v0.31.0 Configs+Sneak peek](https://youtu.be/X3444KfjguE)
39+
* [K9s v0.30.0 Sneak peek](https://youtu.be/mVBc1XneRJ4)
40+
* [Vulnerability Scans](https://youtu.be/ULkl0MsaidU)
41+
42+
---
43+
44+
## Resolved Issues
45+
46+
* [#2463](https://github.com/derailed/k9s/issues/2463) v0.31.3 (Linux_amd64) gives runtime error on startup
47+
48+
---
49+
50+
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/imhotep_logo.png" width="32" height="auto"/> © 2024 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)

cmd/root.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ func loadConfiguration() (*config.Config, error) {
115115
k8sCfg := client.NewConfig(k8sFlags)
116116
k9sCfg := config.NewConfig(k8sCfg)
117117
if err := k9sCfg.Load(config.AppConfigFile); err != nil {
118-
return nil, err
118+
return k9sCfg, err
119119
}
120120
k9sCfg.K9s.Override(k9sFlags)
121121
if err := k9sCfg.Refine(k8sFlags, k9sFlags, k8sCfg); err != nil {
122122
log.Error().Err(err).Msgf("config refine failed")
123-
return nil, err
123+
return k9sCfg, err
124124
}
125125
conn, err := client.InitConnection(k8sCfg)
126126
k9sCfg.SetConnection(conn)
@@ -129,16 +129,16 @@ func loadConfiguration() (*config.Config, error) {
129129
}
130130
// Try to access server version if that fail. Connectivity issue?
131131
if !conn.CheckConnectivity() {
132-
return nil, fmt.Errorf("cannot connect to context: %s", k9sCfg.K9s.ActiveContextName())
132+
return k9sCfg, fmt.Errorf("cannot connect to context: %s", k9sCfg.K9s.ActiveContextName())
133133
}
134134
if !conn.ConnectionOK() {
135-
return nil, fmt.Errorf("k8s connection failed for context: %s", k9sCfg.K9s.ActiveContextName())
135+
return k9sCfg, fmt.Errorf("k8s connection failed for context: %s", k9sCfg.K9s.ActiveContextName())
136136
}
137137

138138
log.Info().Msg("✅ Kubernetes connectivity")
139139
if err := k9sCfg.Save(); err != nil {
140140
log.Error().Err(err).Msg("Config save")
141-
return nil, err
141+
return k9sCfg, err
142142
}
143143

144144
return k9sCfg, nil

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/adrg/xdg v0.4.0
99
github.com/anchore/clio v0.0.0-20231016125544-c98a83e1c7fc
1010
github.com/anchore/grype v0.74.0
11+
github.com/anchore/syft v0.100.0
1112
github.com/atotto/clipboard v0.1.4
1213
github.com/cenkalti/backoff/v4 v4.2.1
1314
github.com/derailed/popeye v0.11.2
@@ -71,7 +72,6 @@ require (
7172
github.com/anchore/go-version v1.2.2-0.20210903204242-51efa5b487c4 // indirect
7273
github.com/anchore/packageurl-go v0.1.1-0.20230104203445-02e0a6721501 // indirect
7374
github.com/anchore/stereoscope v0.0.0-20231220161148-590920dabc54 // indirect
74-
github.com/anchore/syft v0.100.0 // indirect
7575
github.com/andybalholm/brotli v1.0.4 // indirect
7676
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
7777
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46 // indirect

internal/ui/dialog/confirm.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,10 @@ func ShowConfirm(styles config.Dialog, pages *ui.Pages, title, msg string, ack c
8585
cancel()
8686
})
8787
for i := 0; i < 2; i++ {
88-
b := f.GetButton(i)
89-
if b == nil {
90-
continue
88+
if b := f.GetButton(i); b != nil {
89+
b.SetBackgroundColorActivated(styles.ButtonFocusBgColor.Color())
90+
b.SetLabelColorActivated(styles.ButtonFocusFgColor.Color())
9191
}
92-
b.SetBackgroundColorActivated(styles.ButtonFocusBgColor.Color())
93-
b.SetLabelColorActivated(styles.ButtonFocusFgColor.Color())
9492
}
9593
f.SetFocus(0)
9694
modal := tview.NewModalForm("<"+title+">", f)

internal/view/command.go

-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ func (c *Command) run(p *cmd.Interpreter, fqn string, clearStack bool) error {
166166
log.Error().Err(err).Msgf("Context switch failed")
167167
return err
168168
}
169-
170169
if err := c.app.switchContext(p, false); err != nil {
171170
return err
172171
}

internal/view/scale_extender.go

+15-7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"strconv"
1010
"strings"
1111

12+
"github.com/derailed/k9s/internal/config"
13+
1214
"github.com/derailed/k9s/internal/dao"
1315
"github.com/derailed/k9s/internal/ui"
1416
"github.com/derailed/tcell/v2"
@@ -83,7 +85,8 @@ func (s *ScaleExtender) valueOf(col string) (string, error) {
8385
}
8486

8587
func (s *ScaleExtender) makeScaleForm(sels []string) (*tview.Form, error) {
86-
f := s.makeStyledForm()
88+
styles := s.App().Styles.Dialog()
89+
f := s.makeStyledForm(styles)
8790

8891
factor := "0"
8992
if len(sels) == 1 {
@@ -126,10 +129,15 @@ func (s *ScaleExtender) makeScaleForm(sels []string) (*tview.Form, error) {
126129
s.App().Flash().Infof("%s %s scaled successfully", s.GVR().R(), sels[0])
127130
}
128131
})
129-
130132
f.AddButton("Cancel", func() {
131133
s.dismissDialog()
132134
})
135+
for i := 0; i < 2; i++ {
136+
if b := f.GetButton(i); b != nil {
137+
b.SetBackgroundColorActivated(styles.ButtonFocusBgColor.Color())
138+
b.SetLabelColorActivated(styles.ButtonFocusFgColor.Color())
139+
}
140+
}
133141

134142
return f, nil
135143
}
@@ -138,14 +146,14 @@ func (s *ScaleExtender) dismissDialog() {
138146
s.App().Content.RemovePage(scaleDialogKey)
139147
}
140148

141-
func (s *ScaleExtender) makeStyledForm() *tview.Form {
149+
func (s *ScaleExtender) makeStyledForm(styles config.Dialog) *tview.Form {
142150
f := tview.NewForm()
143151
f.SetItemPadding(0)
144152
f.SetButtonsAlign(tview.AlignCenter).
145-
SetButtonBackgroundColor(tview.Styles.PrimitiveBackgroundColor).
146-
SetButtonTextColor(tview.Styles.PrimaryTextColor).
147-
SetLabelColor(tcell.ColorAqua).
148-
SetFieldTextColor(tcell.ColorOrange)
153+
SetButtonBackgroundColor(styles.ButtonBgColor.Color()).
154+
SetButtonTextColor(styles.ButtonBgColor.Color()).
155+
SetLabelColor(styles.LabelFgColor.Color()).
156+
SetFieldTextColor(styles.FieldFgColor.Color())
149157

150158
return f
151159
}

snap/snapcraft.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: k9s
22
base: core20
3-
version: 'v0.31.3'
3+
version: 'v0.31.4'
44
summary: K9s is a CLI to view and manage your Kubernetes clusters.
55
description: |
66
K9s is a CLI to view and manage your Kubernetes clusters. By leveraging a terminal UI, you can easily traverse Kubernetes resources and view the state of your clusters in a single powerful session.

0 commit comments

Comments
 (0)