follower

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 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) Connect added in v0.10.0

func (f *Follower) Connect(lo metav1.ListOptions) error

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) SetBuildRunName added in v0.10.0

func (f *Follower) SetBuildRunName(brName types.NamespacedName)

SetBuildRunName allows for setting of the BuildRun name after to call to NewFollower. This help service auto generation of the BuildRun name from the Build. NOTE, if the BuildRun name is not set prior to the call to WaitForCompletion, the Follower will not function fully once events arrive.

func (*Follower) SetFailPollInterval added in v0.10.0

func (f *Follower) SetFailPollInterval(t time.Duration)

SetFailPollInterval overrides the default value used in polling calls

func (*Follower) SetFailPollTimeout added in v0.10.0

func (f *Follower) SetFailPollTimeout(t time.Duration)

SetFailPollTimeout overrides the default value used in polling calls

func (*Follower) Start

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

Start is a convenience method for capturing the use of both Connect and WaitForCompletion

func (*Follower) Stop added in v0.8.0

func (f *Follower) Stop()

Stop stop log tail instance.

func (*Follower) WaitForCompletion added in v0.10.0

func (f *Follower) WaitForCompletion() (*corev1.Pod, error)

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

Jump to

Keyboard shortcuts

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