Skip to content

Commit

Permalink
K9s/release v0.31.4 (#2464)
Browse files Browse the repository at this point in the history
* [Bug] Fix scale dialog ui

* [bug] Fix #2463

* v0.31.4 release notes
  • Loading branch information
derailed committed Jan 10, 2024
1 parent 942e61a commit 356c561
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DATE ?= $(shell TZ=UTC date -j -f "%s" ${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:
else
DATE ?= $(shell date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ")
endif
VERSION ?= v0.31.3
VERSION ?= v0.31.4
IMG_NAME := derailed/k9s
IMAGE := ${IMG_NAME}:${VERSION}

Expand Down
50 changes: 50 additions & 0 deletions change_logs/release_v0.31.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/k9s.png" align="center" width="800" height="auto"/>

# Release v0.31.4

## Notes

Thank you to all that contributed with flushing out issues and enhancements for K9s!
I'll try to mark some of these issues as fixed. But if you don't mind grab the latest rev
and see if we're happier with some of the fixes!
If you've filed an issue please help me verify and close.

Your support, kindness and awesome suggestions to make K9s better are, as ever, very much noted and appreciated!
Also big thanks to all that have allocated their own time to help others on both slack and on this repo!!

As you may know, K9s is not pimped out by corps with deep pockets, thus if you feel K9s is helping 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)

On Slack? Please join us [K9slackers](https://join.slack.com/t/k9sers/shared_invite/enQtOTA5MDEyNzI5MTU0LWQ1ZGI3MzliYzZhZWEyNzYxYzA3NjE0YTk1YmFmNzViZjIyNzhkZGI0MmJjYzhlNjdlMGJhYzE2ZGU1NjkyNTM)

## Maintenance Release!

More aftermath...

Thank you all for pitching in and helping flesh out issues!!

Please make sure to add gory details to issues ie relevant configs, debug logs, etc...

Comments like: `same here!` or `me to!` doesn't really help us zero in.
Everyone has slightly different settings/platforms so every little bits of info helps with the resolves.
Thank you!!

---

## Videos Are In The Can!

Please dial [K9s Channel](https://www.youtube.com/channel/UC897uwPygni4QIjkPCpgjmw) for up coming content...

* [K9s v0.31.0 Configs+Sneak peek](https://youtu.be/X3444KfjguE)
* [K9s v0.30.0 Sneak peek](https://youtu.be/mVBc1XneRJ4)
* [Vulnerability Scans](https://youtu.be/ULkl0MsaidU)

---

## Resolved Issues

* [#2463](https://github.com/derailed/k9s/issues/2463) v0.31.3 (Linux_amd64) gives runtime error on startup

---

<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)
10 changes: 5 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ func loadConfiguration() (*config.Config, error) {
k8sCfg := client.NewConfig(k8sFlags)
k9sCfg := config.NewConfig(k8sCfg)
if err := k9sCfg.Load(config.AppConfigFile); err != nil {
return nil, err
return k9sCfg, err
}
k9sCfg.K9s.Override(k9sFlags)
if err := k9sCfg.Refine(k8sFlags, k9sFlags, k8sCfg); err != nil {
log.Error().Err(err).Msgf("config refine failed")
return nil, err
return k9sCfg, err
}
conn, err := client.InitConnection(k8sCfg)
k9sCfg.SetConnection(conn)
Expand All @@ -129,16 +129,16 @@ func loadConfiguration() (*config.Config, error) {
}
// Try to access server version if that fail. Connectivity issue?
if !conn.CheckConnectivity() {
return nil, fmt.Errorf("cannot connect to context: %s", k9sCfg.K9s.ActiveContextName())
return k9sCfg, fmt.Errorf("cannot connect to context: %s", k9sCfg.K9s.ActiveContextName())
}
if !conn.ConnectionOK() {
return nil, fmt.Errorf("k8s connection failed for context: %s", k9sCfg.K9s.ActiveContextName())
return k9sCfg, fmt.Errorf("k8s connection failed for context: %s", k9sCfg.K9s.ActiveContextName())
}

log.Info().Msg("✅ Kubernetes connectivity")
if err := k9sCfg.Save(); err != nil {
log.Error().Err(err).Msg("Config save")
return nil, err
return k9sCfg, err
}

return k9sCfg, nil
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/adrg/xdg v0.4.0
github.com/anchore/clio v0.0.0-20231016125544-c98a83e1c7fc
github.com/anchore/grype v0.74.0
github.com/anchore/syft v0.100.0
github.com/atotto/clipboard v0.1.4
github.com/cenkalti/backoff/v4 v4.2.1
github.com/derailed/popeye v0.11.2
Expand Down Expand Up @@ -71,7 +72,6 @@ require (
github.com/anchore/go-version v1.2.2-0.20210903204242-51efa5b487c4 // indirect
github.com/anchore/packageurl-go v0.1.1-0.20230104203445-02e0a6721501 // indirect
github.com/anchore/stereoscope v0.0.0-20231220161148-590920dabc54 // indirect
github.com/anchore/syft v0.100.0 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46 // indirect
Expand Down
8 changes: 3 additions & 5 deletions internal/ui/dialog/confirm.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ func ShowConfirm(styles config.Dialog, pages *ui.Pages, title, msg string, ack c
cancel()
})
for i := 0; i < 2; i++ {
b := f.GetButton(i)
if b == nil {
continue
if b := f.GetButton(i); b != nil {
b.SetBackgroundColorActivated(styles.ButtonFocusBgColor.Color())
b.SetLabelColorActivated(styles.ButtonFocusFgColor.Color())
}
b.SetBackgroundColorActivated(styles.ButtonFocusBgColor.Color())
b.SetLabelColorActivated(styles.ButtonFocusFgColor.Color())
}
f.SetFocus(0)
modal := tview.NewModalForm("<"+title+">", f)
Expand Down
1 change: 0 additions & 1 deletion internal/view/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ func (c *Command) run(p *cmd.Interpreter, fqn string, clearStack bool) error {
log.Error().Err(err).Msgf("Context switch failed")
return err
}

if err := c.app.switchContext(p, false); err != nil {
return err
}
Expand Down
22 changes: 15 additions & 7 deletions internal/view/scale_extender.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"strconv"
"strings"

"github.com/derailed/k9s/internal/config"

"github.com/derailed/k9s/internal/dao"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/tcell/v2"
Expand Down Expand Up @@ -83,7 +85,8 @@ func (s *ScaleExtender) valueOf(col string) (string, error) {
}

func (s *ScaleExtender) makeScaleForm(sels []string) (*tview.Form, error) {
f := s.makeStyledForm()
styles := s.App().Styles.Dialog()
f := s.makeStyledForm(styles)

factor := "0"
if len(sels) == 1 {
Expand Down Expand Up @@ -126,10 +129,15 @@ func (s *ScaleExtender) makeScaleForm(sels []string) (*tview.Form, error) {
s.App().Flash().Infof("%s %s scaled successfully", s.GVR().R(), sels[0])
}
})

f.AddButton("Cancel", func() {
s.dismissDialog()
})
for i := 0; i < 2; i++ {
if b := f.GetButton(i); b != nil {
b.SetBackgroundColorActivated(styles.ButtonFocusBgColor.Color())
b.SetLabelColorActivated(styles.ButtonFocusFgColor.Color())
}
}

return f, nil
}
Expand All @@ -138,14 +146,14 @@ func (s *ScaleExtender) dismissDialog() {
s.App().Content.RemovePage(scaleDialogKey)
}

func (s *ScaleExtender) makeStyledForm() *tview.Form {
func (s *ScaleExtender) makeStyledForm(styles config.Dialog) *tview.Form {
f := tview.NewForm()
f.SetItemPadding(0)
f.SetButtonsAlign(tview.AlignCenter).
SetButtonBackgroundColor(tview.Styles.PrimitiveBackgroundColor).
SetButtonTextColor(tview.Styles.PrimaryTextColor).
SetLabelColor(tcell.ColorAqua).
SetFieldTextColor(tcell.ColorOrange)
SetButtonBackgroundColor(styles.ButtonBgColor.Color()).
SetButtonTextColor(styles.ButtonBgColor.Color()).
SetLabelColor(styles.LabelFgColor.Color()).
SetFieldTextColor(styles.FieldFgColor.Color())

return f
}
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: k9s
base: core20
version: 'v0.31.3'
version: 'v0.31.4'
summary: K9s is a CLI to view and manage your Kubernetes clusters.
description: |
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.
Expand Down

0 comments on commit 356c561

Please sign in to comment.