diff --git a/Dockerfile b/Dockerfile index a93bd4b8..cd2b57e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # ----------------------------------------------------------------------------- # The base image for building the k9s binary -FROM golang:1.16.5-alpine3.14.0 AS build +FROM golang:1.16.5-alpine3.13 AS build WORKDIR /k9s COPY go.mod go.sum main.go Makefile ./ diff --git a/Makefile b/Makefile index cb722f4d..52ca571b 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ PACKAGE := github.com/derailed/$(NAME) GIT_REV ?= $(shell git rev-parse --short HEAD) SOURCE_DATE_EPOCH ?= $(shell date +%s) DATE ?= $(shell date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ") -VERSION ?= v0.24.11 +VERSION ?= v0.24.12 IMG_NAME := derailed/k9s IMAGE := ${IMG_NAME}:${VERSION} diff --git a/change_logs/release_v0.24.12.md b/change_logs/release_v0.24.12.md new file mode 100644 index 00000000..ac90c791 --- /dev/null +++ b/change_logs/release_v0.24.12.md @@ -0,0 +1,42 @@ + + +# Release v0.24.12 + +## 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) + +## Prompt GOT Styles! + +Added a new configuration for styling your command/search prompts. So you can now specify foreground/background and suggestion color to your heart content. For example: + +```yaml +# $HOME/.k9s/skin.yml +k9s: + body: + fgColor: aqua + bgColor: black + logoColor: purple + # Prompt styles + prompt: + fgColor: blue + bgColor: black + suggestColor: orange + ... +``` + +--- + +## Resolved Issues + +* [Issue #1169](https://github.com/derailed/k9s/issues/1169) Scaling last deployment errors out +* [Issue #1167](https://github.com/derailed/k9s/issues/1167) Cronjob trigger busted +* [Issue #1163](https://github.com/derailed/k9s/issues/1163) Color for autocomplete text + +--- + + © 2020 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0) diff --git a/internal/config/styles.go b/internal/config/styles.go index 3b78e10b..e1ca257b 100644 --- a/internal/config/styles.go +++ b/internal/config/styles.go @@ -35,6 +35,7 @@ type ( // Style tracks K9s styles. Style struct { Body Body `yaml:"body"` + Prompt Prompt `yaml:"prompt"` Help Help `yaml:"help"` Frame Frame `yaml:"frame"` Info Info `yaml:"info"` @@ -42,6 +43,13 @@ type ( Dialog Dialog `yaml:"dialog"` } + // Prompt tracks command styles + Prompt struct { + FgColor Color `yaml:"fgColor"` + BgColor Color `yaml:"bgColor"` + SuggestColor Color `yaml:"suggestColor"` + } + // Help tracks help styles. Help struct { FgColor Color `yaml:"fgColor"` @@ -246,6 +254,7 @@ func (c Colors) Colors() []tcell.Color { func newStyle() Style { return Style{ Body: newBody(), + Prompt: newPrompt(), Help: newHelp(), Frame: newFrame(), Info: newInfo(), @@ -267,6 +276,14 @@ func newDialog() Dialog { } } +func newPrompt() Prompt { + return Prompt{ + FgColor: "cadetBlue", + BgColor: "black", + SuggestColor: "dodgerblue", + } +} + func newCharts() Charts { return Charts{ BgColor: "black", diff --git a/internal/ui/prompt.go b/internal/ui/prompt.go index a4bf6950..b5e5d35f 100644 --- a/internal/ui/prompt.go +++ b/internal/ui/prompt.go @@ -94,8 +94,8 @@ func NewPrompt(noIcons bool, styles *config.Styles) *Prompt { p.SetDynamicColors(true) p.SetBorder(true) p.SetBorderPadding(0, 0, 1, 1) - p.SetBackgroundColor(styles.BgColor()) - p.SetTextColor(styles.FgColor()) + p.SetBackgroundColor(styles.K9s.Prompt.BgColor.Color()) + p.SetTextColor(styles.K9s.Prompt.FgColor.Color()) styles.AddListener(&p) p.SetInputCapture(p.keyboard) @@ -164,8 +164,8 @@ func (p *Prompt) keyboard(evt *tcell.EventKey) *tcell.EventKey { // StylesChanged notifies skin changed. func (p *Prompt) StylesChanged(s *config.Styles) { p.styles = s - p.SetBackgroundColor(s.BgColor()) - p.SetTextColor(s.FgColor()) + p.SetBackgroundColor(s.K9s.Prompt.BgColor.Color()) + p.SetTextColor(s.K9s.Prompt.FgColor.Color()) } // InCmdMode returns true if command is active, false otherwise. @@ -196,7 +196,7 @@ func (p *Prompt) write(text, suggest string) { p.SetCursorIndex(p.spacer + len(text)) txt := text if suggest != "" { - txt += "[dodgerblue::-]" + suggest + txt += fmt.Sprintf("[%s::-]%s", p.styles.K9s.Prompt.SuggestColor, suggest) } fmt.Fprintf(p, defaultPrompt, p.icon, txt) } diff --git a/internal/view/registrar.go b/internal/view/registrar.go index 11b99017..7c006f3a 100644 --- a/internal/view/registrar.go +++ b/internal/view/registrar.go @@ -135,9 +135,6 @@ func rbacViewers(vv MetaViewers) { } func batchViewers(vv MetaViewers) { - vv[client.NewGVR("batch/v1/cronjobs")] = MetaViewer{ - viewerFn: NewCronJob, - } vv[client.NewGVR("batch/v1beta1/cronjobs")] = MetaViewer{ viewerFn: NewCronJob, } diff --git a/skins/axual.yml b/skins/axual.yml index d58dc015..d8d48d11 100644 --- a/skins/axual.yml +++ b/skins/axual.yml @@ -1,11 +1,11 @@ # Axual Skin contributed by [@JayKus](jimmy@axual.com) # Style -blue: &blue '#113851' -red: &red '#D7595F' -yellow: &yellow '#F2BF40' -cyan: &cyan '#47B0AB' -grey: &grey '#A99688' -light: &light '#F1EFE4' +blue: &blue "#113851" +red: &red "#D7595F" +yellow: &yellow "#F2BF40" +cyan: &cyan "#47B0AB" +grey: &grey "#A99688" +light: &light "#F1EFE4" # Skin k9s: @@ -13,7 +13,13 @@ k9s: body: fgColor: *yellow bgColor: *blue - logoColor: 'orange' + logoColor: orange + + # Command prompt styles + prompt: + fgColor: *yellow + bgColor: *blue + suggestColor: orange # ClusterInfoView styles info: @@ -67,7 +73,7 @@ k9s: bgColor: *blue highlightColor: *cyan counterColor: *light - filterColor: 'slategray' + filterColor: "slategray" # Specific views styles views: # TableView attributes. @@ -79,7 +85,7 @@ k9s: header: fgColor: *light bgColor: *blue - sorterColor: 'orange' + sorterColor: "orange" # Xray style xray: diff --git a/skins/black_and_wtf.yml b/skins/black_and_wtf.yml index e98ac68f..281ffacf 100644 --- a/skins/black_and_wtf.yml +++ b/skins/black_and_wtf.yml @@ -17,6 +17,10 @@ k9s: fgColor: *fg bgColor: *bg logoColor: *fg + prompt: + fgColor: *fg + bgColor: *bg + suggestColor: &gray info: fgColor: *text sectionColor: *fg diff --git a/skins/dracula.yml b/skins/dracula.yml index 09b03303..38d63278 100644 --- a/skins/dracula.yml +++ b/skins/dracula.yml @@ -19,6 +19,11 @@ k9s: fgColor: *foreground bgColor: *background logoColor: *purple + # Command prompt styles + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *purple # ClusterInfoView styles. info: fgColor: *pink diff --git a/skins/gruvbox-dark.yml b/skins/gruvbox-dark.yml index 7eaf5969..1088e31b 100644 --- a/skins/gruvbox-dark.yml +++ b/skins/gruvbox-dark.yml @@ -16,6 +16,10 @@ k9s: fgColor: *foreground bgColor: *background logoColor: *blue + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *orange info: fgColor: *magenta sectionColor: *foreground diff --git a/skins/gruvbox-light.yml b/skins/gruvbox-light.yml index c982bfd2..15e38a4a 100644 --- a/skins/gruvbox-light.yml +++ b/skins/gruvbox-light.yml @@ -16,6 +16,10 @@ k9s: fgColor: *foreground bgColor: *background logoColor: *blue + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *orange info: fgColor: *magenta sectionColor: *foreground diff --git a/skins/in_the_navy.yml b/skins/in_the_navy.yml index 3f5ee347..552291de 100644 --- a/skins/in_the_navy.yml +++ b/skins/in_the_navy.yml @@ -23,6 +23,10 @@ k9s: fgColor: *fg bgColor: *bg logoColor: *blue + prompt: + fgColor: *fg + bgColor: *bg + suggestColor: *cadet info: fgColor: *sky sectionColor: *steel diff --git a/skins/kiss.yml b/skins/kiss.yml index 6593f3ef..c65829c4 100644 --- a/skins/kiss.yml +++ b/skins/kiss.yml @@ -4,6 +4,10 @@ k9s: fgColor: default bgColor: default logoColor: default + prompt: + fgColor: default + bgColor: default + suggestColor: default info: fgColor: default sectionColor: default diff --git a/skins/monokai.yml b/skins/monokai.yml index 6c77268f..04605bc6 100644 --- a/skins/monokai.yml +++ b/skins/monokai.yml @@ -18,6 +18,11 @@ k9s: fgColor: *foreground bgColor: *background logoColor: *magenta + # Command prompt styles + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *orange # ClusterInfoView styles. info: fgColor: *blue @@ -94,7 +99,7 @@ k9s: - *magenta v1/pods: - *blue - - *magenta + - *magenta # TableView attributes. table: fgColor: *foreground diff --git a/skins/nord.yml b/skins/nord.yml index 1076ce18..d481159d 100644 --- a/skins/nord.yml +++ b/skins/nord.yml @@ -17,6 +17,11 @@ k9s: fgColor: *foreground bgColor: default logoColor: *magenta + # Command prompt styles + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *orange # ClusterInfoView styles. info: fgColor: *blue diff --git a/skins/one_dark.yml b/skins/one_dark.yml index 67c3f7e4..564aab49 100644 --- a/skins/one_dark.yml +++ b/skins/one_dark.yml @@ -16,6 +16,10 @@ k9s: fgColor: *foreground bgColor: *background logoColor: *green + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *orange info: fgColor: *grey sectionColor: *green diff --git a/skins/snazzy.yml b/skins/snazzy.yml index ebd3ff91..b101007a 100644 --- a/skins/snazzy.yml +++ b/skins/snazzy.yml @@ -3,6 +3,10 @@ k9s: fgColor: "#97979b" bgColor: "#282a36" logoColor: "#5af78e" + prompt: + fgColor: "#97979b" + bgColor: "#282a36" + suggestColor: "#5af78e" info: fgColor: white sectionColor: "#5af78e" diff --git a/skins/solarized_dark.yml b/skins/solarized_dark.yml index 11b5ed07..0f7d4e4d 100644 --- a/skins/solarized_dark.yml +++ b/skins/solarized_dark.yml @@ -16,6 +16,10 @@ k9s: fgColor: *foreground bgColor: *background logoColor: *blue + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *orange info: fgColor: *magenta sectionColor: *foreground diff --git a/skins/solarized_light.yml b/skins/solarized_light.yml index f7241f8b..008fc4b1 100644 --- a/skins/solarized_light.yml +++ b/skins/solarized_light.yml @@ -17,6 +17,10 @@ k9s: fgColor: *foreground bgColor: *background logoColor: *blue + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *orange info: fgColor: *magenta sectionColor: *foreground diff --git a/skins/stock.yml b/skins/stock.yml index 0133a120..c9db8f3a 100644 --- a/skins/stock.yml +++ b/skins/stock.yml @@ -3,6 +3,10 @@ k9s: fgColor: dodgerblue bgColor: black logoColor: orange + prompt: + fgColor: cadetblue + bgColor: black + suggestColor: dodgerblue info: fgColor: white sectionColor: dodgerblue