added extra env vars

mine
derailed 2019-10-03 11:09:13 -06:00
parent ffd1c61c8c
commit b93030b09b
4 changed files with 24 additions and 5 deletions

View File

@ -257,7 +257,6 @@ func initKeys() {
initNumbKeys() initNumbKeys()
initStdKeys() initStdKeys()
initShiftKeys() initShiftKeys()
initCtrlKeys()
} }
func initNumbKeys() { func initNumbKeys() {

View File

@ -13,7 +13,7 @@ import (
const ( const (
aliasTitle = "Aliases" aliasTitle = "Aliases"
aliasTitleFmt = " [aqua::b]%s([fuchsia::b]%d[fuchsia::-][aqua::-]) " aliasTitleFmt = " [mediumseagreen::b]%s([fuchsia::b]%d[fuchsia::-][mediumseagreen::-]) "
) )
type aliasView struct { type aliasView struct {
@ -29,8 +29,8 @@ func newAliasView(app *appView, current ui.Igniter) *aliasView {
tableView: newTableView(app, aliasTitle), tableView: newTableView(app, aliasTitle),
app: app, app: app,
} }
v.SetBorderFocusColor(tcell.ColorFuchsia) v.SetBorderFocusColor(tcell.ColorMediumSpringGreen)
v.SetSelectedStyle(tcell.ColorWhite, tcell.ColorFuchsia, tcell.AttrNone) v.SetSelectedStyle(tcell.ColorWhite, tcell.ColorMediumSpringGreen, tcell.AttrNone)
v.SetColorerFn(aliasColorer) v.SetColorerFn(aliasColorer)
v.current = current v.current = current
v.SetActiveNS("") v.SetActiveNS("")

View File

@ -29,7 +29,7 @@ func benchColorer(ns string, r *resource.RowEvent) tcell.Color {
} }
func aliasColorer(string, *resource.RowEvent) tcell.Color { func aliasColorer(string, *resource.RowEvent) tcell.Color {
return tcell.ColorFuchsia return tcell.ColorMediumSpringGreen
} }
func rbacColorer(ns string, r *resource.RowEvent) tcell.Color { func rbacColorer(ns string, r *resource.RowEvent) tcell.Color {

View File

@ -456,9 +456,29 @@ func (v *resourceView) execCmd(bin string, bg bool, args ...string) ui.ActionHan
func (v *resourceView) defaultK9sEnv() K9sEnv { func (v *resourceView) defaultK9sEnv() K9sEnv {
ns, n := namespaced(v.masterPage().GetSelectedItem()) ns, n := namespaced(v.masterPage().GetSelectedItem())
ctx, err := v.app.Conn().Config().CurrentContextName()
if err != nil {
ctx = "n/a"
}
cluster, err := v.app.Conn().Config().CurrentClusterName()
if err != nil {
cluster = "n/a"
}
user, err := v.app.Conn().Config().CurrentUserName()
if err != nil {
user = "n/a"
}
groups, err := v.app.Conn().Config().CurrentGroupNames()
if err != nil {
groups = []string{"n/a"}
}
env := K9sEnv{ env := K9sEnv{
"NAMESPACE": ns, "NAMESPACE": ns,
"NAME": n, "NAME": n,
"CONTEXT": ctx,
"CLUSTER": cluster,
"USER": user,
"GROUPS": strings.Join(groups, ","),
} }
row := v.masterPage().GetRow() row := v.masterPage().GetRow()
for i, r := range row { for i, r := range row {