Fernand Galiana 2021-12-28 09:52:33 -07:00 committed by GitHub
parent 2a9f5464c3
commit 6085039f83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 8 deletions

View File

@ -5,7 +5,7 @@ PACKAGE := github.com/derailed/$(NAME)
GIT_REV ?= $(shell git rev-parse --short HEAD) GIT_REV ?= $(shell git rev-parse --short HEAD)
SOURCE_DATE_EPOCH ?= $(shell date +%s) SOURCE_DATE_EPOCH ?= $(shell date +%s)
DATE ?= $(shell date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ") DATE ?= $(shell date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ")
VERSION ?= v0.25.17 VERSION ?= v0.25.18
IMG_NAME := derailed/k9s IMG_NAME := derailed/k9s
IMAGE := ${IMG_NAME}:${VERSION} IMAGE := ${IMG_NAME}:${VERSION}

View File

@ -0,0 +1,25 @@
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/k9s.png" align="center" width="800" height="auto"/>
# Release v0.25.18
## 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!
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
---
## Resolved Issues
* [Issue #1402](https://github.com/derailed/k9s/issues/1402) Sort functionality does not work properly on v0.25.16. With Feelings!
---
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/imhotep_logo.png" width="32" height="auto"/> © 2021 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)

View File

@ -103,7 +103,7 @@ func (s *SelectTable) SelectRow(r int, broadcast bool) {
if !broadcast { if !broadcast {
s.SetSelectionChangedFunc(nil) s.SetSelectionChangedFunc(nil)
} }
if r >= s.model.Count() { if s.model.Count() > 0 && r >= s.model.Count() {
r = s.model.Count() r = s.model.Count()
} }
defer s.SetSelectionChangedFunc(s.selectionChanged) defer s.SetSelectionChangedFunc(s.selectionChanged)

View File

@ -191,18 +191,14 @@ func (t *Table) Update(data render.TableData, hasMetrics bool) {
func (t *Table) doUpdate(data render.TableData) { func (t *Table) doUpdate(data render.TableData) {
if client.IsAllNamespaces(data.Namespace) { if client.IsAllNamespaces(data.Namespace) {
t.actions[KeyShiftP] = NewKeyAction("Sort Namespace", t.SortColCmd("NAMESPACE", true), false) t.actions[KeyShiftP] = NewKeyAction("Sort Namespace", t.SortColCmd("NAMESPACE", true), false)
t.sortCol.name = "NAMESPACE"
} else { } else {
t.actions.Delete(KeyShiftP) t.actions.Delete(KeyShiftP)
} }
var cols []string cols := t.header.Columns(t.wide)
if t.viewSetting != nil { if t.viewSetting != nil && len(t.viewSetting.Columns) > 0 {
cols = t.viewSetting.Columns cols = t.viewSetting.Columns
} }
if len(cols) == 0 {
cols = t.header.Columns(t.wide)
}
custData := data.Customize(cols, t.wide) custData := data.Customize(cols, t.wide)
if t.viewSetting != nil && t.viewSetting.SortColumn != "" { if t.viewSetting != nil && t.viewSetting.SortColumn != "" {
tokens := strings.Split(t.viewSetting.SortColumn, ":") tokens := strings.Split(t.viewSetting.SortColumn, ":")
@ -214,6 +210,9 @@ func (t *Table) doUpdate(data render.TableData) {
} }
} }
if t.sortCol.name == "" && client.IsAllNamespaces(data.Namespace) {
t.sortCol.name = "NAMESPACE"
}
if t.sortCol.name == "" || (t.sortCol.name == "NAMESPACE" && !client.IsAllNamespaces(data.Namespace)) && len(custData.Header) > 0 { if t.sortCol.name == "" || (t.sortCol.name == "NAMESPACE" && !client.IsAllNamespaces(data.Namespace)) && len(custData.Header) > 0 {
if idx := custData.Header.IndexOf("NAME", false); idx >= 0 { if idx := custData.Header.IndexOf("NAME", false); idx >= 0 {
t.sortCol.name = custData.Header[idx].Name t.sortCol.name = custData.Header[idx].Name