cleaning up

mine
derailed 2021-08-07 07:29:47 -06:00
parent 13d52f120f
commit 7e2dab2a66
9 changed files with 10 additions and 1 deletions

View File

@ -35,7 +35,7 @@ func NewLogItems() *LogItems {
} }
} }
// Len returns the items length. // Items returns the log items.
func (l *LogItems) Items() []*LogItem { func (l *LogItems) Items() []*LogItem {
l.mx.RLock() l.mx.RLock()
defer l.mx.RUnlock() defer l.mx.RUnlock()

View File

@ -501,6 +501,7 @@ func (p *Pod) isControlled(path string) (string, bool, error) {
return "", false, nil return "", false, nil
} }
// GetDefaultLogContainer returns a container name if specified in an annotation.
func GetDefaultLogContainer(m metav1.ObjectMeta, spec v1.PodSpec) (string, bool) { func GetDefaultLogContainer(m metav1.ObjectMeta, spec v1.PodSpec) (string, bool) {
defaultContainer, ok := m.Annotations[defaultLogContainerAnnotation] defaultContainer, ok := m.Annotations[defaultLogContainerAnnotation]
if ok { if ok {

View File

@ -68,7 +68,9 @@ type Primitive interface {
Name() string Name() string
} }
// Commander tracks prompt status.
type Commander interface { type Commander interface {
// InCmdMode checks if prompt is active.
InCmdMode() bool InCmdMode() bool
} }

View File

@ -82,6 +82,7 @@ func (b *Browser) Init(ctx context.Context) error {
return nil return nil
} }
// InCmdMode checks if prompt is active.
func (b *Browser) InCmdMode() bool { func (b *Browser) InCmdMode() bool {
return b.CmdBuff().InCmdMode() return b.CmdBuff().InCmdMode()
} }

View File

@ -75,6 +75,7 @@ func (d *Details) Init(_ context.Context) error {
return nil return nil
} }
// InCmdMode checks if prompt is active.
func (d *Details) InCmdMode() bool { func (d *Details) InCmdMode() bool {
return d.cmdBuff.InCmdMode() return d.cmdBuff.InCmdMode()
} }

View File

@ -80,6 +80,7 @@ func (v *LiveView) Init(_ context.Context) error {
return nil return nil
} }
// InCmdMode checks if prompt is active.
func (v *LiveView) InCmdMode() bool { func (v *LiveView) InCmdMode() bool {
return v.cmdBuff.InCmdMode() return v.cmdBuff.InCmdMode()
} }

View File

@ -108,6 +108,7 @@ func (p *Pulse) Init(ctx context.Context) error {
return nil return nil
} }
// InCmdMode checks if prompt is active.
func (*Pulse) InCmdMode() bool { func (*Pulse) InCmdMode() bool {
return false return false
} }

View File

@ -84,6 +84,7 @@ func (s *Sanitizer) Init(ctx context.Context) error {
return nil return nil
} }
// InCmdMode checks if prompt is active.
func (*Sanitizer) InCmdMode() bool { func (*Sanitizer) InCmdMode() bool {
return false return false
} }

View File

@ -92,6 +92,7 @@ func (x *Xray) Init(ctx context.Context) error {
return nil return nil
} }
// InCmdMode checks if prompt is active.
func (*Xray) InCmdMode() bool { func (*Xray) InCmdMode() bool {
return false return false
} }