merge master

mine
derailed 2021-06-29 23:33:05 -06:00
commit 1f20af4da6
20 changed files with 137 additions and 20 deletions

View File

@ -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 ./

View File

@ -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}

View File

@ -0,0 +1,42 @@
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/k9s_small.png" align="right" width="200" height="auto"/>
# 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
---
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/imhotep_logo.png" width="32" height="auto"/> © 2020 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)

View File

@ -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",

View File

@ -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)
}

View File

@ -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,
}

View File

@ -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:

View File

@ -17,6 +17,10 @@ k9s:
fgColor: *fg
bgColor: *bg
logoColor: *fg
prompt:
fgColor: *fg
bgColor: *bg
suggestColor: &gray
info:
fgColor: *text
sectionColor: *fg

View File

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

View File

@ -16,6 +16,10 @@ k9s:
fgColor: *foreground
bgColor: *background
logoColor: *blue
prompt:
fgColor: *foreground
bgColor: *background
suggestColor: *orange
info:
fgColor: *magenta
sectionColor: *foreground

View File

@ -16,6 +16,10 @@ k9s:
fgColor: *foreground
bgColor: *background
logoColor: *blue
prompt:
fgColor: *foreground
bgColor: *background
suggestColor: *orange
info:
fgColor: *magenta
sectionColor: *foreground

View File

@ -23,6 +23,10 @@ k9s:
fgColor: *fg
bgColor: *bg
logoColor: *blue
prompt:
fgColor: *fg
bgColor: *bg
suggestColor: *cadet
info:
fgColor: *sky
sectionColor: *steel

View File

@ -4,6 +4,10 @@ k9s:
fgColor: default
bgColor: default
logoColor: default
prompt:
fgColor: default
bgColor: default
suggestColor: default
info:
fgColor: default
sectionColor: default

View File

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

View File

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

View File

@ -16,6 +16,10 @@ k9s:
fgColor: *foreground
bgColor: *background
logoColor: *green
prompt:
fgColor: *foreground
bgColor: *background
suggestColor: *orange
info:
fgColor: *grey
sectionColor: *green

View File

@ -3,6 +3,10 @@ k9s:
fgColor: "#97979b"
bgColor: "#282a36"
logoColor: "#5af78e"
prompt:
fgColor: "#97979b"
bgColor: "#282a36"
suggestColor: "#5af78e"
info:
fgColor: white
sectionColor: "#5af78e"

View File

@ -16,6 +16,10 @@ k9s:
fgColor: *foreground
bgColor: *background
logoColor: *blue
prompt:
fgColor: *foreground
bgColor: *background
suggestColor: *orange
info:
fgColor: *magenta
sectionColor: *foreground

View File

@ -17,6 +17,10 @@ k9s:
fgColor: *foreground
bgColor: *background
logoColor: *blue
prompt:
fgColor: *foreground
bgColor: *background
suggestColor: *orange
info:
fgColor: *magenta
sectionColor: *foreground

View File

@ -3,6 +3,10 @@ k9s:
fgColor: dodgerblue
bgColor: black
logoColor: orange
prompt:
fgColor: cadetblue
bgColor: black
suggestColor: dodgerblue
info:
fgColor: white
sectionColor: dodgerblue