From d60054c5317e369c5e3782efab093a73a764ccd1 Mon Sep 17 00:00:00 2001 From: derailed Date: Wed, 31 Mar 2021 10:38:13 -0600 Subject: [PATCH] maintenance #1067 #1061 #1060 --- change_logs/release_v0.24.7.md | 42 +++++++++++++++++++++++++++++++++ go.mod | 4 +++- go.sum | 2 -- internal/render/hpa.go | 9 ++++--- internal/view/image_extender.go | 22 +++++++++++------ 5 files changed, 64 insertions(+), 15 deletions(-) create mode 100644 change_logs/release_v0.24.7.md diff --git a/change_logs/release_v0.24.7.md b/change_logs/release_v0.24.7.md new file mode 100644 index 00000000..73650a38 --- /dev/null +++ b/change_logs/release_v0.24.7.md @@ -0,0 +1,42 @@ + + +# Release v0.24.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! + +If you feel K9s is helping your Kubernetes journey, please consider joining our [sponsorhip 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! + +## Disturbance In The Farce.. Windows! + +Splendid! So I had to borrow my neighbors kids 20 pounds windows `gaming` laptop for this one ;( Recent K9s drops are looking less than optimal on windows due to dependencies changes. +I was able to narrow it down to named colors are no longer being respected on Windows platforms. I'll keep digging on this but if you find yourself in the situation where K9s is looking less than optimal on Windows, for the short term please either use a custom skin with hex colors or change the stock skin to use hex color values vs named colors. Thank you! + +## There are some that call me... Alpha! + +K9s is still and will remain an open source software. As such it is free and we will continue to maintain this repo! + +That said in order to support our efforts, we've recently launched [K9sAlpha](https://k9salpha.io) which is a freemium version of K9s. K9sAlpha unlocks additional features and enhancements. + +If you would like to support us, you can either join our github sponsors or purchase a K9sAlpha license. If you are an active member of our github sponsorship program, you are eligible for a free K9sAlpha license. Please reach out for your shoe-phone and contact us for your personalized license key. + + + +--- + +## Resolved Issues + +* [Issue #1067](https://github.com/derailed/k9s/issues/1067) Increase HPA target column display +* [Issue #1061](https://github.com/derailed/k9s/issues/1061) Container shell Windows (Don't do windows so please help verify!) +* [Issue #1060](https://github.com/derailed/k9s/issues/1060) Exception when setting container image + +## Resolved PRs + +--- + + © 2020 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0) diff --git a/go.mod b/go.mod index 32d4b03f..4eca983f 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/derailed/k9s go 1.16 +replace github.com/derailed/tview => ../tview + replace ( github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d github.com/docker/docker => github.com/moby/moby v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible @@ -12,7 +14,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/cenkalti/backoff/v4 v4.1.0 github.com/derailed/popeye v0.9.0 - github.com/derailed/tview v0.5.2 + github.com/derailed/tview v0.5.3 github.com/drone/envsubst v1.0.2 // indirect github.com/emicklei/go-restful v2.15.0+incompatible // indirect github.com/fatih/color v1.10.0 diff --git a/go.sum b/go.sum index d6031966..c96d6175 100644 --- a/go.sum +++ b/go.sum @@ -191,8 +191,6 @@ github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xb github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/derailed/popeye v0.9.0 h1:0zP4BAzo94RUjrUkzgF962v0zL9B3xyopd7kU7tMxuc= github.com/derailed/popeye v0.9.0/go.mod h1:g3hudQlbEEChCA7U44fA+utTM9xQpD4pINUMQaiq5Gs= -github.com/derailed/tview v0.5.2 h1:zrvgRdLODdRhOnhPq013KcXXb/tjXC2Z+MOtSmwqmCM= -github.com/derailed/tview v0.5.2/go.mod h1:Cd1rHezeTZDlze2WsQMuGFwiooP1bO0RttWj7XtZbFM= github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= diff --git a/internal/render/hpa.go b/internal/render/hpa.go index 0d80ba17..9444e2d5 100644 --- a/internal/render/hpa.go +++ b/internal/render/hpa.go @@ -148,20 +148,19 @@ func toMetricsV2b1(specs []autoscalingv2beta1.MetricSpec, statuses []autoscaling return MissingValue } - list, count := []string{}, 0 + list := make([]string, 0, len(specs)) for i, spec := range specs { list = append(list, checkHPAType(i, spec, statuses)) - count++ } - max, more := 2, false - if count > max { + max, more := 10, false + if len(list) > max { list, more = list[:max], true } ret := strings.Join(list, ", ") if more { - return ret + " + " + strconv.Itoa(count-max) + "more..." + return ret + " + " + strconv.Itoa(len(list)-max) + "more..." } return ret diff --git a/internal/view/image_extender.go b/internal/view/image_extender.go index 9acf8d09..31b764f1 100644 --- a/internal/view/image_extender.go +++ b/internal/view/image_extender.go @@ -70,27 +70,34 @@ func (s *ImageExtender) setImageCmd(evt *tcell.EventKey) *tcell.EventKey { s.Stop() defer s.Start() - s.showImageDialog(path) + if err := s.showImageDialog(path); err != nil { + s.App().Flash().Err(err) + } return nil } -func (s *ImageExtender) showImageDialog(path string) { - confirm := tview.NewModalForm("", s.makeSetImageForm(path)) +func (s *ImageExtender) showImageDialog(path string) error { + form, err := s.makeSetImageForm(path) + if err != nil { + return err + } + confirm := tview.NewModalForm("", form) confirm.SetText(fmt.Sprintf("Set image %s %s", s.GVR(), path)) confirm.SetDoneFunc(func(int, string) { s.dismissDialog() }) s.App().Content.AddPage(imageKey, confirm, false, false) s.App().Content.ShowPage(imageKey) + + return nil } -func (s *ImageExtender) makeSetImageForm(sel string) *tview.Form { +func (s *ImageExtender) makeSetImageForm(sel string) (*tview.Form, error) { f := s.makeStyledForm() podSpec, err := s.getPodSpec(sel) if err != nil { - s.App().Flash().Err(err) - return nil + return nil, err } formContainerLines := make([]*imageFormSpec, 0, len(podSpec.InitContainers)+len(podSpec.Containers)) for _, spec := range podSpec.InitContainers { @@ -126,7 +133,8 @@ func (s *ImageExtender) makeSetImageForm(sel string) *tview.Form { f.AddButton("Cancel", func() { s.dismissDialog() }) - return f + + return f, nil } func (s *ImageExtender) dismissDialog() {