Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.32.6 #2955

Merged
merged 8 commits into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -53,10 +53,8 @@ linters-settings:
- nilness
goimports:
local-prefixes: github.com/cilium/cilium
staticcheck:
go: "1.20"
unused:
go: "1.20"
go: "1.23"
goheader:
values:
regexp:
@@ -93,7 +91,7 @@ issues:
text: "SA9003: empty branch"
- linters: [staticcheck]
text: "SA2001: empty critical section"
- linters: [goerr113]
- linters: [err113]
text: "do not define dynamic errors, use wrapped static errors instead" # This rule to avoid opinionated check fmt.Errorf("text")
# Skip goimports check on generated files
- path: \\.(generated\\.deepcopy|pb)\\.go$
@@ -107,13 +105,12 @@ issues:
linters:
disable-all: true
enable:
- goerr113
- err113
- gofmt
- goimports
- govet
- ineffassign
- misspell
- staticcheck
- unused
- goheader
- gosec
4 changes: 3 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

project_name: k9s

before:
@@ -90,7 +92,7 @@ brews:
commit_author:
name: derailed
email: fernand@imhotep.io
folder: Formula
directory: Formula
homepage: https://k9scli.io/
description: Kubernetes CLI To Manage Your Clusters In Style!
test: |
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go
go_import_path: github.com/derailed/k9s
go:
- "1.15"
- "1.23"

jobs:
include:
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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.32.5
VERSION ?= v0.32.6
IMG_NAME := derailed/k9s
IMAGE := ${IMG_NAME}:${VERSION}

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

# Release v0.32.6

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

---

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

* [#2947](https://github.com/derailed/k9s/issues/2947) CTRL+Z causes k9s to crash
* [#2938](https://github.com/derailed/k9s/issues/2938) Critical Vulnerability CVE-2024-41110 in v26.0.1 of docker included in k9s
* [#2929](https://github.com/derailed/k9s/issues/2929) conflicting plugins shortcuts
* [#2896](https://github.com/derailed/k9s/issues/2896) Add a plugin to disable/enable a keda ScaledObject
* [#2811](https://github.com/derailed/k9s/issues/2811) Dockerfile build step fails due to misaligned Go versions (1.21.5 vs 1.22.0)
* [#2767](https://github.com/derailed/k9s/issues/2767) Manually triggered jobs don't get automatically cleaned up
* [#2761](https://github.com/derailed/k9s/issues/2761) Enable "jump to owner" for more kinds
* [#2754](https://github.com/derailed/k9s/issues/2754) Plugins not loaded/shown in UI
* [#2747](https://github.com/derailed/k9s/issues/2747) Combining context and namespace switching only works sporadically (e.g. ":pod foo-ns @ctx-dev")
* [#2746](https://github.com/derailed/k9s/issues/2746) k9s does not display "[::]" string in its logs
* [#2738](https://github.com/derailed/k9s/issues/2738) "Faults" view should show all Terminating pods

---

## Contributed PRs

Please be sure to give `Big Thanks!` and `ATTA Girls/Boys!` to all the fine contributors for making K9s better for all of us!!

* [#2937](https://github.com/derailed/k9s/pull/2937) Adding Argo Rollouts plugin version for PowerShell
* [#2935](https://github.com/derailed/k9s/pull/2935) fix: show all terminating pods in Faults view (#2738)
* [#2933](https://github.com/derailed/k9s/pull/2933) chore: broken url in build-status tag in the readme.md
* [#2932](https://github.com/derailed/k9s/pull/2932) fix: add kubeconfig if k9s is launched with --kubeconfig
* [#2930](https://github.com/derailed/k9s/pull/2930) fixed conflicting plugin shortcuts, and added 2 new plugins
* [#2927](https://github.com/derailed/k9s/pull/2927) Fix "Mark Range": reduce maximum namespaces in favorites, fix shadowing of ctrl+space
* [#2926](https://github.com/derailed/k9s/pull/2926) chore(plugins,remove-finalizers): make sure the resources api group is respected
* [#2921](https://github.com/derailed/k9s/pull/2921) feat: Add plugins for kubectl node-shell
* [#2920](https://github.com/derailed/k9s/pull/2920) eat: added StartupProbes status (S) to the PROBES column in the container render
* [#2914](https://github.com/derailed/k9s/pull/2914) Adding eks-node-viewer plugin
* [#2898](https://github.com/derailed/k9s/pull/2898) Add argocd plugin to community plugins
* [#2896](https://github.com/derailed/k9s/pull/2896) feat(2896): Add toggle keda plugin
* [#2890](https://github.com/derailed/k9s/pull/2890) Update README.md
* [#2881](https://github.com/derailed/k9s/pull/2881) Fix Mark-Range command: ensure that NS Favorite doesn't exceed the limit
* [#2861](https://github.com/derailed/k9s/pull/2861) chore: fix function name
* [#2856](https://github.com/derailed/k9s/pull/2856) fix internal/render/hpa.go merge issue
* [#2848](https://github.com/derailed/k9s/pull/2848) Include sidecar containers requests and limits
* [#2844](https://github.com/derailed/k9s/pull/2844) Update README GO Version Required
* [#2830](https://github.com/derailed/k9s/pull/2830) update tview to fix log escaping problem completely
* [#2822](https://github.com/derailed/k9s/pull/2822) Adding HolmesGPT plugin
* [#2821](https://github.com/derailed/k9s/pull/2821) Add a spark-operator plugin
* [#2817](https://github.com/derailed/k9s/pull/2817) Add comment about Escape keybinding
* [#2812](https://github.com/derailed/k9s/pull/2812) fix: align build image Go version with go.mod
* [#2795](https://github.com/derailed/k9s/pull/2795) add new plugin current-ctx-terminal
* [#2791](https://github.com/derailed/k9s/pull/2791) Add leading space to Kubernetes context suggestions
* [#2789](https://github.com/derailed/k9s/pull/2789) Create kubectl-get-in-shell.yaml
* [#2788](https://github.com/derailed/k9s/pull/2788) Update README.md plugin format
* [#2787](https://github.com/derailed/k9s/pull/2787) Update helm-purge.yaml
* [#2786](https://github.com/derailed/k9s/pull/2786) Update README.md with plugin dangerous field
* [#2780](https://github.com/derailed/k9s/pull/2780) install copyright file into correct location
* [#2775](https://github.com/derailed/k9s/pull/2775) fix freebsd build failure
* [#2780](https://github.com/derailed/k9s/pull/2780) install copyright file into correct location
* [#2772](https://github.com/derailed/k9s/pull/2772) proper handle OwnerReference for manually created job
* [#2771](https://github.com/derailed/k9s/pull/2771) feat: add duplik8s plugin
* [#2770](https://github.com/derailed/k9s/pull/2770) feat: allow plugins block in plugin files
* [#2765](https://github.com/derailed/k9s/pull/2765) fix: Shellin -> ShellIn
* [#2763](https://github.com/derailed/k9s/pull/2763) enable "jump to owner" for more kinds
* [#2755](https://github.com/derailed/k9s/pull/2755) Loki plugin
* [#2751](https://github.com/derailed/k9s/pull/2751) container logs should be escaped when printed
* [#2750](https://github.com/derailed/k9s/pull/2750) fix: should switching ctx before ns

---

<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)
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/derailed/k9s

go 1.22.0
go 1.23.0

require (
github.com/adrg/xdg v0.5.0
@@ -314,8 +314,8 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gorm.io/gorm v1.25.9 // indirect
k8s.io/apiserver v0.31.1 // indirect
k8s.io/component-base v0.31.1 // indirect
k8s.io/apiserver v0.31.2 // indirect
k8s.io/component-base v0.31.2 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
modernc.org/libc v1.41.0 // indirect
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1864,14 +1864,14 @@ k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/
k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ=
k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw=
k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/apiserver v0.31.1 h1:Sars5ejQDCRBY5f7R3QFHdqN3s61nhkpaX8/k1iEw1c=
k8s.io/apiserver v0.31.1/go.mod h1:lzDhpeToamVZJmmFlaLwdYZwd7zB+WYRYIboqA1kGxM=
k8s.io/apiserver v0.31.2 h1:VUzOEUGRCDi6kX1OyQ801m4A7AUPglpsmGvdsekmcI4=
k8s.io/apiserver v0.31.2/go.mod h1:o3nKZR7lPlJqkU5I3Ove+Zx3JuoFjQobGX1Gctw6XuE=
k8s.io/cli-runtime v0.31.1 h1:/ZmKhmZ6hNqDM+yf9s3Y4KEYakNXUn5sod2LWGGwCuk=
k8s.io/cli-runtime v0.31.1/go.mod h1:pKv1cDIaq7ehWGuXQ+A//1OIF+7DI+xudXtExMCbe9U=
k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc=
k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs=
k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8=
k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w=
k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA=
k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
2 changes: 1 addition & 1 deletion internal/client/metrics.go
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ func (m *MetricsServer) checkAccess(ns, gvr, msg string) error {
return err
}
if !auth {
return fmt.Errorf(msg)
return errors.New(msg)
}
return nil
}
2 changes: 1 addition & 1 deletion internal/config/data/ns.go
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ func (n *Namespace) Validate(c client.Connection) {
if len(n.Favorites) > MaxFavoritesNS {
log.Debug().Msgf("[Namespace] Number of favorite exceeds hard limit of %v. Trimming.", MaxFavoritesNS)
for _, ns := range n.Favorites[MaxFavoritesNS:] {
n.rmFavNS(ns)
n.rmFavNS(ns)
}
}
}
12 changes: 5 additions & 7 deletions internal/config/data/ns_test.go
Original file line number Diff line number Diff line change
@@ -36,14 +36,12 @@ func TestNSValidateNoNS(t *testing.T) {
}

func TestNsValidateMaxNS(t *testing.T) {
allNS := []string{"ns9","ns8","ns7","ns6","ns5","ns4", "ns3", "ns2", "ns1", "all", "default"}
ns := data.NewNamespace()

ns.Favorites = allNS

ns.Validate(mock.NewMockConnection())
allNS := []string{"ns9", "ns8", "ns7", "ns6", "ns5", "ns4", "ns3", "ns2", "ns1", "all", "default"}
ns := data.NewNamespace()
ns.Favorites = allNS

assert.Equal(t, data.MaxFavoritesNS, len(ns.Favorites))
ns.Validate(mock.NewMockConnection())
assert.Equal(t, data.MaxFavoritesNS, len(ns.Favorites))
}

func TestNSSetActive(t *testing.T) {
14 changes: 0 additions & 14 deletions internal/config/feature.go

This file was deleted.

6 changes: 3 additions & 3 deletions internal/config/views.go
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ func (v *ViewSetting) SortCol() (string, bool, error) {
return "", false, fmt.Errorf("invalid sort column spec: %q. must be col-name:asc|desc", v.SortColumn)
}

return tt[0], tt[1] == "desc", nil
return tt[0], tt[1] == "asc", nil
}

func (v *ViewSetting) Equals(vs *ViewSetting) bool {
@@ -116,8 +116,8 @@ func (v *CustomView) RemoveListener(gvr string) {

func (v *CustomView) fireConfigChanged() {
for gvr, list := range v.listeners {
if v, ok := v.Views[gvr]; ok {
list.ViewSettingsChanged(v)
if view, ok := v.Views[gvr]; ok {
list.ViewSettingsChanged(view)
} else {
list.ViewSettingsChanged(ViewSetting{})
}
2 changes: 1 addition & 1 deletion internal/dao/alias.go
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ func (a *Alias) AsGVR(c string) (client.GVR, string, bool) {

// Get fetch a resource.
func (a *Alias) Get(_ context.Context, _ string) (runtime.Object, error) {
return nil, errors.New("NYI!!")
return nil, errors.New("nyi")
}

// Ensure makes sure alias are loaded.
46 changes: 30 additions & 16 deletions internal/dao/container.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ package dao
import (
"context"
"fmt"
"strconv"

"github.com/derailed/k9s/internal"
"github.com/derailed/k9s/internal/client"
@@ -22,6 +23,12 @@ var (
_ Loggable = (*Container)(nil)
)

const (
initIDX = "I"
mainIDX = "M"
ephIDX = "E"
)

// Container represents a pod's container dao.
type Container struct {
NonResource
@@ -46,12 +53,15 @@ func (c *Container) List(ctx context.Context, _ string) ([]runtime.Object, error
if err != nil {
return nil, err
}
res := make([]runtime.Object, 0, len(po.Spec.InitContainers)+len(po.Spec.Containers))
for _, co := range po.Spec.InitContainers {
res = append(res, makeContainerRes(co, po, cmx[co.Name], true))
res := make([]runtime.Object, 0, len(po.Spec.InitContainers)+len(po.Spec.Containers)+len(po.Spec.EphemeralContainers))
for i, co := range po.Spec.InitContainers {
res = append(res, makeContainerRes(initIDX, i, co, po, cmx[co.Name]))
}
for i, co := range po.Spec.Containers {
res = append(res, makeContainerRes(mainIDX, i, co, po, cmx[co.Name]))
}
for _, co := range po.Spec.Containers {
res = append(res, makeContainerRes(co, po, cmx[co.Name], false))
for i, co := range po.Spec.EphemeralContainers {
res = append(res, makeContainerRes(ephIDX, i, v1.Container(co.EphemeralContainerCommon), po, cmx[co.Name]))
}

return res, nil
@@ -68,25 +78,29 @@ func (c *Container) TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan,
// ----------------------------------------------------------------------------
// Helpers...

func makeContainerRes(co v1.Container, po *v1.Pod, cmx *mv1beta1.ContainerMetrics, isInit bool) render.ContainerRes {
func makeContainerRes(kind string, idx int, co v1.Container, po *v1.Pod, cmx *mv1beta1.ContainerMetrics) render.ContainerRes {
return render.ContainerRes{
Idx: kind + strconv.Itoa(idx+1),
Container: &co,
Status: getContainerStatus(co.Name, po.Status),
Status: getContainerStatus(kind, idx, po.Status),
MX: cmx,
IsInit: isInit,
Age: po.GetCreationTimestamp(),
}
}

func getContainerStatus(co string, status v1.PodStatus) *v1.ContainerStatus {
for _, c := range status.ContainerStatuses {
if c.Name == co {
return &c
func getContainerStatus(kind string, idx int, status v1.PodStatus) *v1.ContainerStatus {
switch kind {
case mainIDX:
if idx < len(status.ContainerStatuses) {
return &status.ContainerStatuses[idx]
}
}
for _, c := range status.InitContainerStatuses {
if c.Name == co {
return &c
case initIDX:
if idx < len(status.InitContainerStatuses) {
return &status.InitContainerStatuses[idx]
}
case ephIDX:
if idx < len(status.EphemeralContainerStatuses) {
return &status.EphemeralContainerStatuses[idx]
}
}

4 changes: 2 additions & 2 deletions internal/dao/dir.go
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ var yamlRX = regexp.MustCompile(`.*\.(yml|yaml|json)`)
func (a *Dir) List(ctx context.Context, _ string) ([]runtime.Object, error) {
dir, ok := ctx.Value(internal.KeyPath).(string)
if !ok {
return nil, errors.New("No dir in context")
return nil, errors.New("no dir in context")
}

files, err := os.ReadDir(dir)
@@ -61,5 +61,5 @@ func (a *Dir) List(ctx context.Context, _ string) ([]runtime.Object, error) {

// Get fetch a resource.
func (a *Dir) Get(_ context.Context, _ string) (runtime.Object, error) {
return nil, errors.New("NYI!!")
return nil, errors.New("nyi")
}
2 changes: 1 addition & 1 deletion internal/dao/dp.go
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ func (d *Deployment) TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan,
return nil, err
}
if dp.Spec.Selector == nil || len(dp.Spec.Selector.MatchLabels) == 0 {
return nil, fmt.Errorf("No valid selector found on Deployment %s", opts.Path)
return nil, fmt.Errorf("no valid selector found on deployment: %s", opts.Path)
}

return podLogs(ctx, dp.Spec.Selector.MatchLabels, opts)
Loading