stern

package
v0.31.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 12 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, allowErrors, disablePodLogs bool) error

Run starts the main run loop

func Watch

func Watch(ctx context.Context, i v1.PodInterface, containerState ContainerState, labelSelector labels.Selector, allowErrors bool, onAdded, onRemoved func(*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(ctx context.Context, 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 log message with the pod and container names

func (*Tail) Start

func (t *Tail) Start(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