Skip to content

Commit fc5f190

Browse files
authored
Rel v0.40.9 (#3205)
* update write icon * fix#3202 * rel docs * update linter * lint * test * lint
1 parent 39eef03 commit fc5f190

File tree

25 files changed

+556
-214
lines changed

25 files changed

+556
-214
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
cache-dependency-path: go.sum
1919

2020
- name: Lint
21-
uses: golangci/golangci-lint-action@v6.5.0
21+
uses: golangci/golangci-lint-action@v6.5.1
2222
with:
2323
github_token: ${{ secrets.GITHUB_TOKEN }}
2424
reporter: github-pr-check

.golangci.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ linters-settings:
5050
goimports:
5151
local-prefixes: github.com/cilium/cilium
5252
unused:
53-
go: "1.23"
53+
parameters-are-used: true
54+
local-variables-are-used: true
55+
field-writes-are-uses: true
56+
post-statements-are-reads: true
57+
exported-fields-are-used: true
58+
generated-is-used: true
5459
goheader:
5560
values:
5661
regexp:
@@ -61,23 +66,6 @@ linters-settings:
6166
gosec:
6267
includes:
6368
- G402
64-
gomodguard:
65-
blocked:
66-
modules:
67-
- github.com/miekg/dns:
68-
recommendations:
69-
- github.com/cilium/dns
70-
reason: "use the cilium fork directly to avoid replace directives in go.mod, see https://github.com/cilium/cilium/pull/27582"
71-
- gopkg.in/check.v1:
72-
recommendations:
73-
- testing
74-
- github.com/stretchr/testify/assert
75-
reason: "gocheck has been deprecated, see https://docs.cilium.io/en/latest/contributing/testing/unit/#migrating-tests-off-of-gopkg-in-check-v1"
76-
- go.uber.org/multierr:
77-
recommendations:
78-
- errors
79-
reason: "Go 1.20+ has support for combining multiple errors, see https://go.dev/doc/go1.20#errors"
80-
8169
sloglint:
8270
# Enforce not mixing key-value pairs and attributes.
8371
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-mixed-arguments
@@ -138,7 +126,7 @@ issues:
138126

139127
# default is true. Enables skipping of directories:
140128
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
141-
skip-dirs-use-default: true
129+
exclude-dirs-use-default: true
142130

143131
# Excluding configuration per-path, per-linter, per-text and per-source
144132
exclude-rules:

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.40.8
14+
VERSION ?= v0.40.9
1515
IMG_NAME := derailed/k9s
1616
IMAGE := ${IMG_NAME}:${VERSION}
1717

README.md

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,15 @@ views:
726726
727727
## Plugins
728728
729-
K9s allows you to extend your command line and tooling by defining your very own cluster commands via plugins. K9s will look at `$XDG_CONFIG_HOME/k9s/plugins.yaml` to locate all available plugins.
729+
K9s allows you to extend your command line and tooling by defining your very own cluster commands via plugins.
730+
Minimally we look at `$XDG_CONFIG_HOME/k9s/plugins.yaml` to locate all available plugins.
731+
Additionally, K9s will scan the following directories for additional plugins:
732+
733+
* `$XDG_CONFIG_HOME/k9s/plugins`
734+
* `$XDG_DATA_HOME/k9s/plugins`
735+
* `$XDG_DATA_DIRS/k9s/plugins`
736+
737+
The plugin file content can be either a single plugin snippet, a collections of snippets or a complete plugins definition (see examples below...).
730738
731739
A plugin is defined as follows:
732740
@@ -760,12 +768,15 @@ K9s does provide additional environment variables for you to customize your plug
760768
761769
Curly braces can be used to embed an environment variable inside another string, or if the column name contains special characters. (e.g. `${NAME}-example` or `${COL-%CPU/L}`)
762770
763-
### Plugin Example
771+
### Plugin Examples
772+
773+
Define several plugins and host them in a single file. These can leave in the K9s root config so that they are available on any clusters. Additionally, you can define cluster/context specific plugins for your clusters of choice by adding clusterA/contextB/plugins.yaml file.
764774
765-
This defines a plugin for viewing logs on a selected pod using `ctrl-l` as shortcut.
775+
The following defines a plugin for viewing logs on a selected pod using `ctrl-l` as shortcut.
766776
767777
```yaml
768-
# $XDG_DATA_HOME/k9s/plugins.yaml
778+
# Define several plugins in a single file in the K9s root configuration
779+
# $XDG_DATA_HOME/k9s/plugins.yaml
769780
plugins:
770781
# Defines a plugin to provide a `ctrl-l` shortcut to tail the logs while in pod view.
771782
fred:
@@ -789,6 +800,41 @@ plugins:
789800
- $CONTEXT
790801
```
791802
803+
Similarly you can define the plugin above in a directory using either a file per plugin or several plugins per files as follow...
804+
805+
The following defines two plugins namely fred and zorg.
806+
807+
```yaml
808+
# Multiple plugins in a single file...
809+
# Note: as of v0.40.9 you can have ad-hoc plugin dirs
810+
# Loads plugins fred and zorg
811+
# $XDG_DATA_HOME/k9s/plugins/misc-plugins/blee.yaml
812+
fred:
813+
shortCut: Shift-B
814+
description: Bozo
815+
scopes:
816+
- deploy
817+
command: bozo
818+
819+
zorg:
820+
shortCut: Shift-Z
821+
description: Pod logs
822+
scopes:
823+
- svc
824+
command: zorg
825+
```
826+
827+
Lastly you can define plugin snippets in their own file. The snippet will be named from the file name. In this case, we define a `bozo` plugin using a plugin snippet.
828+
829+
```yaml
830+
# $XDG_DATA_HOME/k9s/plugins/schtuff/bozo.yaml
831+
shortCut: Shift-B
832+
description: Bozo
833+
scopes:
834+
- deploy
835+
command: bozo
836+
```
837+
792838
> NOTE: This is an experimental feature! Options and layout may change in future K9s releases as this feature solidifies.
793839
794840
---

change_logs/release_v0.40.9.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/k9s.png" align="center" width="800" height="auto"/>
2+
3+
# Release v0.40.9
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+
* Refactored plugins implementation, hopefully we didn't hose them 😳
23+
* Updated plugins docs
24+
* Apparently when it comes to icons, I've chosen... poorly 🙀
25+
Updated `write` icon 🔓->✍️, hopefully for the better 👀??
26+
27+
## Videos Are In The Can!
28+
29+
Please dial [K9s Channel](https://www.youtube.com/channel/UC897uwPygni4QIjkPCpgjmw) for up coming content...
30+
31+
* [K9s v0.40.0 -Column Blow- Sneak peek](https://youtu.be/iy6RDozAM4A)
32+
* [K9s v0.31.0 Configs+Sneak peek](https://youtu.be/X3444KfjguE)
33+
* [K9s v0.30.0 Sneak peek](https://youtu.be/mVBc1XneRJ4)
34+
* [Vulnerability Scans](https://youtu.be/ULkl0MsaidU)
35+
36+
---
37+
38+
## Resolved Issues
39+
40+
* [#3202](https://github.com/derailed/k9s/issues/3202) 0.40.8 breaks plugins loading
41+
42+
---
43+
44+
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/imhotep_logo.png" width="32" height="auto"/> © 2025 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)

internal/config/helpers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func isStringSet(s *string) bool {
2828

2929
func isYamlFile(file string) bool {
3030
ext := filepath.Ext(file)
31+
3132
return ext == ".yml" || ext == ".yaml"
3233
}
3334

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "K9s plugin-multi schema",
4+
"type": "object",
5+
"additionalProperties": {
6+
"$ref": "file://internal/config/json/schemas/plugin.json",
7+
"additionalProperties": false
8+
}
9+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "K9s plugin schema",
4+
"type": "object",
5+
"additionalProperties": false,
6+
"properties": {
7+
"shortCut": { "type": "string" },
8+
"override": { "type": "boolean" },
9+
"description": { "type": "string" },
10+
"confirm": { "type": "boolean" },
11+
"dangerous": { "type": "boolean" },
12+
"scopes": {
13+
"type": "array",
14+
"items": { "type": "string" }
15+
},
16+
"command": { "type": "string" },
17+
"background": { "type": "boolean" },
18+
"overwriteOutput": { "type": "boolean" },
19+
"args": {
20+
"type": "array",
21+
"items": { "type": ["string", "number"] }
22+
}
23+
},
24+
"required": ["shortCut", "description", "scopes", "command"]
25+
}

internal/config/json/schemas/plugins.json

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
"plugins": {
88
"type": "object",
99
"additionalProperties": {
10-
"type": "object",
11-
"additionalProperties": false,
12-
"properties": {
13-
"shortCut": { "type": "string" },
14-
"override": { "type": "boolean" },
15-
"description": { "type": "string" },
16-
"confirm": { "type": "boolean" },
17-
"dangerous": { "type": "boolean" },
18-
"scopes": {
19-
"type": "array",
20-
"items": { "type": "string" }
21-
},
22-
"command": { "type": "string" },
23-
"background": { "type": "boolean" },
24-
"overwriteOutput": { "type": "boolean" },
25-
"args": {
26-
"type": "array",
27-
"items": { "type": ["string", "number"] }
28-
}
29-
},
30-
"required": ["shortCut", "description", "scopes", "command"]
10+
"$ref": "file://internal/config/json/schemas/plugin.json",
11+
"additionalProperties": false
3112
},
3213
"required": []
3314
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
shortCut: g
2+
confirm: false
3+
description: blee
4+
scopes:
5+
- namespaces
6+
command: sh
7+
background: false
8+
args:
9+
- -c
10+
- "blee bla"

0 commit comments

Comments
 (0)