follower

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Follower

type Follower struct {
	// contains filtered or unexported fields
}

Follower encapsulate the function of tailing the logs for Pods derived from BuildRuns

func NewFollower

func NewFollower(
	ctx context.Context,
	buildRun types.NamespacedName,
	ioStreams *genericclioptions.IOStreams,
	pw *reactor.PodWatcher,
	clientset kubernetes.Interface,
	buildClientset buildclientset.Interface,
) *Follower

NewFollower returns a Follower instance.

func (*Follower) GetLogLock

func (f *Follower) GetLogLock() *sync.Mutex

GetLogLock returns the mutex used for coordinating access to log buffers.

func (*Follower) Log

func (f *Follower) Log(msg string)

Log prints a message

func (*Follower) OnEvent

func (f *Follower) OnEvent(pod *corev1.Pod) error

OnEvent reacts on pod state changes, to start and stop tailing container logs.

func (*Follower) OnNoPodEventsYet

func (f *Follower) OnNoPodEventsYet(podList *corev1.PodList)

OnNoPodEventsYet reacts to the pod watcher telling us it has not received any pod events for our build run

func (*Follower) OnTimeout

func (f *Follower) OnTimeout(msg string)

OnTimeout reacts to either the context or request timeout causing the pod watcher to exit

func (*Follower) Start

func (f *Follower) Start(lo metav1.ListOptions) (*corev1.Pod, error)

Start initiates the log following for the referenced BuildRun's Pod

func (*Follower) Stop added in v0.8.0

func (f *Follower) Stop()

Stop stop log tail instance.

Jump to

Keyboard shortcuts

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