stern

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RUNNING    = "running"
	WAITING    = "waiting"
	TERMINATED = "terminated"
)

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, namespace string, clientset *kubernetes.Clientset) error

Run starts the main run loop

func Watch

func Watch(ctx context.Context, i v1.PodInterface, podFilter *regexp.Regexp, containerFilter *regexp.Regexp, containerState ContainerState, labelSelector labels.Selector) (chan *Target, chan *Target, error)

Watch starts listening to Kubernetes events and emits modified containers/pods. The first result is targets added, the second is targets removed

Types

type ContainerState

type ContainerState string

func NewContainerState

func NewContainerState(stateConfig string) (ContainerState, error)

func (ContainerState) Match

func (stateConfig ContainerState) Match(containerState v1.ContainerState) bool

type Tail

type Tail struct {
	Namespace     string
	PodName       string
	ContainerName string
	// contains filtered or unexported fields
}

func NewTail

func NewTail(namespace, podName, containerName string) *Tail

NewTail returns a new tail for a Kubernetes container inside a pod

func (*Tail) Close

func (t *Tail) Close()

Close stops tailing

func (*Tail) Print

func (t *Tail) Print(msg string)

Print prints a color coded log message with the pod and container names

func (*Tail) Start

func (t *Tail) Start(ctx context.Context, i v1.PodInterface)

Start starts tailing

type Target

type Target struct {
	Namespace string
	Pod       string
	Container string
}

Target is a target to watch

func (*Target) GetID

func (t *Target) GetID() string

GetID returns the ID of the object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL