pod

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Pods   *v1.PodList
	Config *config.Config
}

Manager is responsible for fetching logs from the pods & containers that match the criteria provided by the user.

func NewManagerFromClientSet

func NewManagerFromClientSet(clientSet *kubernetes.Clientset, config *config.Config) (pm *Manager, err error)

NewManagerFromClientSet returns a Manager instance for a given clientset.

func (*Manager) GetTargets

func (pm *Manager) GetTargets() (res []*Target)

GetTargets returns the Target instances for the PodList of Manager.

type Target

type Target struct {
	Context   string
	Namespace string
	Pod       string
	Container string
}

Target holds the necessary information for a container inside a pod. Each container is converted into a Target instance in order to fetch logs.

func NewTarget

func NewTarget(context, namespace, pod, container string) *Target

NewTarget return a target instance.

func (*Target) StartThread

func (l *Target) StartThread(core v1.CoreV1Interface, wg *sync.WaitGroup, w io.Writer) error

StartThread is meant to run as a goroutine and fetch logs until the target goes down or process is stopped by the user.

Jump to

Keyboard shortcuts

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