Skip to content

Commit ecb2536

Browse files
authored
K9s/release v0.31.7 (#2491)
* fix #2488 * rel v0.31.7
1 parent a543f47 commit ecb2536

File tree

5 files changed

+64
-19
lines changed

5 files changed

+64
-19
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
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.6
14+
VERSION ?= v0.31.7
1515
IMG_NAME := derailed/k9s
1616
IMAGE := ${IMG_NAME}:${VERSION}
1717

change_logs/release_v0.31.7.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/k9s.png" align="center" width="800" height="auto"/>
2+
3+
# Release v0.31.7
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 cut it for us to zero in ;(
29+
Everyone has slightly different settings/platforms so every little bits of info helps with the resolves even if seemingly irrelevant.
30+
31+
---
32+
33+
## Videos Are In The Can!
34+
35+
Please dial [K9s Channel](https://www.youtube.com/channel/UC897uwPygni4QIjkPCpgjmw) for up coming content...
36+
37+
* [K9s v0.31.0 Configs+Sneak peek](https://youtu.be/X3444KfjguE)
38+
* [K9s v0.30.0 Sneak peek](https://youtu.be/mVBc1XneRJ4)
39+
* [Vulnerability Scans](https://youtu.be/ULkl0MsaidU)
40+
41+
---
42+
43+
## Resolved Issues
44+
45+
* [#2488](https://github.com/derailed/k9s/issues/2488) linux_amd64 "--kubeconfig" not working on v0.31.6
46+
47+
---
48+
49+
<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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -357,25 +357,20 @@ type (
357357
)
358358

359359
func initK8sFlagCompletion() {
360-
conn := client.NewConfig(k8sFlags)
361-
cfg, err := conn.RawConfig()
362-
if err != nil {
363-
log.Error().Err(err).Msgf("k8s config getter failed")
364-
}
365-
366-
_ = rootCmd.RegisterFlagCompletionFunc("context", k8sFlagCompletion(&cfg, func(cfg *api.Config) map[string]*api.Context {
360+
_ = rootCmd.RegisterFlagCompletionFunc("context", k8sFlagCompletion(func(cfg *api.Config) map[string]*api.Context {
367361
return cfg.Contexts
368362
}))
369363

370-
_ = rootCmd.RegisterFlagCompletionFunc("cluster", k8sFlagCompletion(&cfg, func(cfg *api.Config) map[string]*api.Cluster {
364+
_ = rootCmd.RegisterFlagCompletionFunc("cluster", k8sFlagCompletion(func(cfg *api.Config) map[string]*api.Cluster {
371365
return cfg.Clusters
372366
}))
373367

374-
_ = rootCmd.RegisterFlagCompletionFunc("user", k8sFlagCompletion(&cfg, func(cfg *api.Config) map[string]*api.AuthInfo {
368+
_ = rootCmd.RegisterFlagCompletionFunc("user", k8sFlagCompletion(func(cfg *api.Config) map[string]*api.AuthInfo {
375369
return cfg.AuthInfos
376370
}))
377371

378372
_ = rootCmd.RegisterFlagCompletionFunc("namespace", func(cmd *cobra.Command, args []string, s string) ([]string, cobra.ShellCompDirective) {
373+
conn := client.NewConfig(k8sFlags)
379374
if c, err := client.InitConnection(conn); err == nil {
380375
if nss, err := c.ValidNamespaceNames(); err == nil {
381376
return filterFlagCompletions(nss, s)
@@ -386,13 +381,15 @@ func initK8sFlagCompletion() {
386381
})
387382
}
388383

389-
func k8sFlagCompletion[T any](cfg *api.Config, picker k8sPickerFn[T]) completeFn {
384+
func k8sFlagCompletion[T any](picker k8sPickerFn[T]) completeFn {
390385
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
391-
if cfg == nil {
392-
return nil, cobra.ShellCompDirectiveError
386+
conn := client.NewConfig(k8sFlags)
387+
cfg, err := conn.RawConfig()
388+
if err != nil {
389+
log.Error().Err(err).Msgf("k8s config getter failed")
393390
}
394391

395-
return filterFlagCompletions(picker(cfg), toComplete)
392+
return filterFlagCompletions(picker(&cfg), toComplete)
396393
}
397394
}
398395

internal/client/config.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ const (
2626
// Config tracks a kubernetes configuration.
2727
type Config struct {
2828
flags *genericclioptions.ConfigFlags
29-
mutex *sync.RWMutex
29+
mx sync.RWMutex
3030
}
3131

3232
// NewConfig returns a new k8s config or an error if the flags are invalid.
3333
func NewConfig(f *genericclioptions.ConfigFlags) *Config {
3434
return &Config{
3535
flags: f,
36-
mutex: &sync.RWMutex{},
3736
}
3837
}
3938

@@ -299,8 +298,8 @@ func (c *Config) CurrentNamespaceName() (string, error) {
299298

300299
// ConfigAccess return the current kubeconfig api server access configuration.
301300
func (c *Config) ConfigAccess() (clientcmd.ConfigAccess, error) {
302-
c.mutex.RLock()
303-
defer c.mutex.RUnlock()
301+
c.mx.RLock()
302+
defer c.mx.RUnlock()
304303

305304
return c.clientConfig().ConfigAccess(), nil
306305
}

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: k9s
22
base: core20
3-
version: 'v0.31.6'
3+
version: 'v0.31.7'
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)