cleaning up
parent
8e41b76edf
commit
13d52f120f
|
|
@ -7,12 +7,12 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/adrg/xdg"
|
||||
"github.com/derailed/k9s/internal/client"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gopkg.in/yaml.v2"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
"github.com/adrg/xdg"
|
||||
)
|
||||
|
||||
// K9sConfig represents K9s configuration dir env var.
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ func NewK9s() *K9s {
|
|||
}
|
||||
}
|
||||
|
||||
// ActiveCluster initializes the active cluster is not present.
|
||||
// ActivateCluster initializes the active cluster is not present.
|
||||
func (k *K9s) ActivateCluster() {
|
||||
if _, ok := k.Clusters[k.CurrentCluster]; ok {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ func (c *Cow) Init(_ context.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// InCmdMode checks if prompt is active.
|
||||
func (*Cow) InCmdMode() bool {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ func (e Env) Substitute(arg string) (string, error) {
|
|||
|
||||
// To prevent the substitution starts with the shorter environment variable,
|
||||
// sort with the length of the found environment variables.
|
||||
sort.Slice(kk, func (i, j int) bool {
|
||||
sort.Slice(kk, func(i, j int) bool {
|
||||
return len(kk[i]) > len(kk[j])
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ func (h *Help) Init(ctx context.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// InCmdMode checks if prompt is active.
|
||||
func (*Help) InCmdMode() bool {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ func (l *Log) Init(ctx context.Context) (err error) {
|
|||
return nil
|
||||
}
|
||||
|
||||
// InCmdMode checks if prompt is active.
|
||||
func (v *Log) InCmdMode() bool {
|
||||
return v.logs.cmdBuff.InCmdMode()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ func (p *Picker) Init(ctx context.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// InCmdMode checks if prompt is active.
|
||||
func (*Picker) InCmdMode() bool {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ func (t *Table) Init(ctx context.Context) (err error) {
|
|||
return nil
|
||||
}
|
||||
|
||||
// HeaderIndex returns index of a given column or false if not found.
|
||||
func (t *Table) HeaderIndex(header string) (int, bool) {
|
||||
for i := 0; i < t.GetColumnCount(); i++ {
|
||||
if h := t.GetCell(0, i); h != nil && h.Text == header {
|
||||
|
|
|
|||
Loading…
Reference in New Issue