diff --git a/Makefile b/Makefile index 15447574..cd6a6b69 100644 --- a/Makefile +++ b/Makefile @@ -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} diff --git a/change_logs/release_v0.31.4.md b/change_logs/release_v0.31.4.md new file mode 100644 index 00000000..62655249 --- /dev/null +++ b/change_logs/release_v0.31.4.md @@ -0,0 +1,50 @@ + + +# 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 + +--- + + © 2024 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0) diff --git a/cmd/root.go b/cmd/root.go index e0c208b7..883f5de6 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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) @@ -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 diff --git a/go.mod b/go.mod index 4ca83ec7..759b0632 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/internal/ui/dialog/confirm.go b/internal/ui/dialog/confirm.go index 6ddcc9d5..461456cb 100644 --- a/internal/ui/dialog/confirm.go +++ b/internal/ui/dialog/confirm.go @@ -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) diff --git a/internal/view/command.go b/internal/view/command.go index 92ea9428..cdc31188 100644 --- a/internal/view/command.go +++ b/internal/view/command.go @@ -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 } diff --git a/internal/view/scale_extender.go b/internal/view/scale_extender.go index 14094dcf..c30e289c 100644 --- a/internal/view/scale_extender.go +++ b/internal/view/scale_extender.go @@ -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" @@ -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 { @@ -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 } @@ -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 } diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 84565fe6..00a04f56 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -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.