job

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailedReport

type FailedReport struct {
	FailedReason string
	JobStatus    JobStatus
}

type Feed

type Feed interface {
	OnAdded(func() error)
	OnSucceeded(func() error)
	OnFailed(func(reason string) error)
	OnEventMsg(func(msg string) error)
	OnAddedPod(func(podName string) error)
	OnPodLogChunk(func(*pod.PodLogChunk) error)
	OnPodError(func(pod.PodError) error)
	OnStatus(func(JobStatus) error)

	GetStatus() JobStatus
	Track(name, namespace string, kube kubernetes.Interface, opts tracker.Options) error
}

func NewFeed

func NewFeed() Feed

type JobStatus

type JobStatus struct {
	batchv1.JobStatus

	StatusGeneration uint64

	SucceededIndicator *indicators.Int32EqualConditionIndicator
	Age                string

	WaitingForMessages []string

	IsSucceeded  bool
	IsFailed     bool
	FailedReason string

	Pods map[string]pod.PodStatus
}

func NewJobStatus

func NewJobStatus(object *batchv1.Job, statusGeneration uint64, isTrackerFailed bool, trackerFailedReason string, podsStatuses map[string]pod.PodStatus, trackedPodsNames []string) JobStatus

type PodAddedReport

type PodAddedReport struct {
	PodName   string
	JobStatus JobStatus
}

type PodErrorReport

type PodErrorReport struct {
	PodError  pod.PodError
	JobStatus JobStatus
}

type Tracker

type Tracker struct {
	tracker.Tracker
	LogsFromTime time.Time

	Added     chan JobStatus
	Succeeded chan JobStatus
	Failed    chan JobStatus
	Status    chan JobStatus

	EventMsg    chan string
	AddedPod    chan PodAddedReport
	PodLogChunk chan *pod.PodLogChunk
	PodError    chan PodErrorReport

	State            tracker.TrackerState
	TrackedPodsNames []string
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(name, namespace string, kube kubernetes.Interface, opts tracker.Options) *Tracker

func (*Tracker) Track

func (job *Tracker) Track(ctx context.Context) error

Jump to

Keyboard shortcuts

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