Skip to content

Commit

Permalink
K9s/release v0.31.3 (#2460)
Browse files Browse the repository at this point in the history
* allow k9s to run with errors

* fixes #2459 #2458 #2454 #2435

* v0.31.3 rel notes
  • Loading branch information
derailed committed Jan 10, 2024
1 parent 65100b0 commit 268def2
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 10 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.2
VERSION ?= v0.31.3
IMG_NAME := derailed/k9s
IMAGE := ${IMG_NAME}:${VERSION}

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

# Release v0.31.3

## 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!

The 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!` 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

* [#2459](https://github.com/derailed/k9s/issues/2459) No permission to see deployments/statefulsets even though I have them
* [#2458](https://github.com/derailed/k9s/issues/2458) panic on run without current context
* [#2454](https://github.com/derailed/k9s/issues/2454) Invoking K9s ends in panic question
* [#2435](https://github.com/derailed/k9s/issues/2435) "yaml: line 15: could not find expected ':'" error bug question (May be??)

---

<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)
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func run(cmd *cobra.Command, args []string) error {

cfg, err := loadConfiguration()
if err != nil {
return err
log.Error().Err(err).Msgf("Fail to load global/context configuration")
}
app := view.NewApp(cfg)
if err := app.Init(version, *k9sFlags.RefreshRate); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion internal/config/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,6 @@ func (a *Aliases) SaveAliases(path string) error {
if err != nil {
return err
}
return os.WriteFile(path, cfg, 0644)

return os.WriteFile(path, cfg, data.DefaultFileMod)
}
8 changes: 6 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (c *Config) Refine(flags *genericclioptions.ConfigFlags, k9sFlags *Flags, c
}
_, err = c.K9s.ActivateContext(n)
if err != nil {
return fmt.Errorf("unable to activate context %q: %w", *flags.Context, err)
return fmt.Errorf("unable to activate context %q: %w", n, err)
}
}
log.Debug().Msgf("Active Context %q", c.K9s.ActiveContextName())
Expand Down Expand Up @@ -149,6 +149,10 @@ func (c *Config) FavNamespaces() []string {

// SetActiveNamespace set the active namespace in the current context.
func (c *Config) SetActiveNamespace(ns string) error {
if ns == client.NotNamespaced {
log.Debug().Msgf("[SetNS] No namespace given. skipping!")
return nil
}
ct, err := c.K9s.ActiveContext()
if err != nil {
return err
Expand Down Expand Up @@ -251,7 +255,7 @@ func (c *Config) SaveFile(path string) error {
return err
}

return os.WriteFile(path, cfg, 0644)
return os.WriteFile(path, cfg, data.DefaultFileMod)
}

// Validate the configuration.
Expand Down
8 changes: 8 additions & 0 deletions internal/config/data/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"os"
"sync"

"github.com/derailed/k9s/internal/client"
"gopkg.in/yaml.v2"
Expand All @@ -16,6 +17,7 @@ import (
// Config tracks a context configuration.
type Config struct {
Context *Context `yaml:"k9s"`
mx sync.RWMutex
}

// NewConfig returns a new config.
Expand All @@ -27,6 +29,9 @@ func NewConfig(ct *api.Context) *Config {

// Validate ensures config is in norms.
func (c *Config) Validate(conn client.Connection, ks KubeSettings) {
c.mx.Lock()
defer c.mx.Unlock()

if c.Context == nil {
c.Context = NewContext()
}
Expand All @@ -42,6 +47,9 @@ func (c *Config) Dump(w io.Writer) {

// Save saves the config to disk.
func (c *Config) Save(path string) error {
c.mx.RLock()
defer c.mx.RUnlock()

if err := EnsureDirPath(path, DefaultDirMod); err != nil {
return err
}
Expand Down
5 changes: 1 addition & 4 deletions internal/config/k9s.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,12 @@ func (k *K9s) ActivateContext(n string) (*data.Context, error) {
// If the context specifies a namespace, use it!
if ns := ct.Namespace; ns != client.BlankNamespace {
k.activeConfig.Context.Namespace.Active = ns
} else {
} else if k.activeConfig.Context.Namespace.Active == "" {
k.activeConfig.Context.Namespace.Active = client.DefaultNamespace
}
if k.activeConfig.Context == nil {
return nil, fmt.Errorf("context activation failed for: %s", n)
}
if k.activeConfig.Context == nil {
return nil, fmt.Errorf("context activation failed for: %s", n)
}

return k.activeConfig.Context, nil
}
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.2'
version: 'v0.31.3'
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 268def2

Please sign in to comment.