diff --git a/Makefile b/Makefile
index d64fd545fc..cba35ac3e6 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.6
+VERSION ?= v0.31.7
IMG_NAME := derailed/k9s
IMAGE := ${IMG_NAME}:${VERSION}
diff --git a/change_logs/release_v0.31.7.md b/change_logs/release_v0.31.7.md
new file mode 100644
index 0000000000..ac4179c8c5
--- /dev/null
+++ b/change_logs/release_v0.31.7.md
@@ -0,0 +1,49 @@
+
+
+# Release v0.31.7
+
+## 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 cut it for us to zero in ;(
+Everyone has slightly different settings/platforms so every little bits of info helps with the resolves even if seemingly irrelevant.
+
+---
+
+## 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
+
+* [#2488](https://github.com/derailed/k9s/issues/2488) linux_amd64 "--kubeconfig" not working on v0.31.6
+
+---
+
+ © 2024 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)
\ No newline at end of file
diff --git a/cmd/root.go b/cmd/root.go
index db029ab92b..2ffc3ea1d1 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -357,25 +357,20 @@ type (
)
func initK8sFlagCompletion() {
- conn := client.NewConfig(k8sFlags)
- cfg, err := conn.RawConfig()
- if err != nil {
- log.Error().Err(err).Msgf("k8s config getter failed")
- }
-
- _ = rootCmd.RegisterFlagCompletionFunc("context", k8sFlagCompletion(&cfg, func(cfg *api.Config) map[string]*api.Context {
+ _ = rootCmd.RegisterFlagCompletionFunc("context", k8sFlagCompletion(func(cfg *api.Config) map[string]*api.Context {
return cfg.Contexts
}))
- _ = rootCmd.RegisterFlagCompletionFunc("cluster", k8sFlagCompletion(&cfg, func(cfg *api.Config) map[string]*api.Cluster {
+ _ = rootCmd.RegisterFlagCompletionFunc("cluster", k8sFlagCompletion(func(cfg *api.Config) map[string]*api.Cluster {
return cfg.Clusters
}))
- _ = rootCmd.RegisterFlagCompletionFunc("user", k8sFlagCompletion(&cfg, func(cfg *api.Config) map[string]*api.AuthInfo {
+ _ = rootCmd.RegisterFlagCompletionFunc("user", k8sFlagCompletion(func(cfg *api.Config) map[string]*api.AuthInfo {
return cfg.AuthInfos
}))
_ = rootCmd.RegisterFlagCompletionFunc("namespace", func(cmd *cobra.Command, args []string, s string) ([]string, cobra.ShellCompDirective) {
+ conn := client.NewConfig(k8sFlags)
if c, err := client.InitConnection(conn); err == nil {
if nss, err := c.ValidNamespaceNames(); err == nil {
return filterFlagCompletions(nss, s)
@@ -386,13 +381,15 @@ func initK8sFlagCompletion() {
})
}
-func k8sFlagCompletion[T any](cfg *api.Config, picker k8sPickerFn[T]) completeFn {
+func k8sFlagCompletion[T any](picker k8sPickerFn[T]) completeFn {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- if cfg == nil {
- return nil, cobra.ShellCompDirectiveError
+ conn := client.NewConfig(k8sFlags)
+ cfg, err := conn.RawConfig()
+ if err != nil {
+ log.Error().Err(err).Msgf("k8s config getter failed")
}
- return filterFlagCompletions(picker(cfg), toComplete)
+ return filterFlagCompletions(picker(&cfg), toComplete)
}
}
diff --git a/internal/client/config.go b/internal/client/config.go
index 0a3253e5fa..28f1d53d88 100644
--- a/internal/client/config.go
+++ b/internal/client/config.go
@@ -26,14 +26,13 @@ const (
// Config tracks a kubernetes configuration.
type Config struct {
flags *genericclioptions.ConfigFlags
- mutex *sync.RWMutex
+ mx sync.RWMutex
}
// NewConfig returns a new k8s config or an error if the flags are invalid.
func NewConfig(f *genericclioptions.ConfigFlags) *Config {
return &Config{
flags: f,
- mutex: &sync.RWMutex{},
}
}
@@ -299,8 +298,8 @@ func (c *Config) CurrentNamespaceName() (string, error) {
// ConfigAccess return the current kubeconfig api server access configuration.
func (c *Config) ConfigAccess() (clientcmd.ConfigAccess, error) {
- c.mutex.RLock()
- defer c.mutex.RUnlock()
+ c.mx.RLock()
+ defer c.mx.RUnlock()
return c.clientConfig().ConfigAccess(), nil
}
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index b0ffecdffa..70e77da71b 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -1,6 +1,6 @@
name: k9s
base: core20
-version: 'v0.31.6'
+version: 'v0.31.7'
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.