jobcontroller

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsJobEqual

func IsJobEqual(orig, updated *execution.Job) (bool, error)

IsJobEqual returns true if the Job is not equal and should be updated. This equality check is only true in the context of the JobController.

func IsJobStatusEqual

func IsJobStatusEqual(orig, updated *execution.Job) (bool, error)

IsJobStatusEqual returns true if the JobStatus is not equal for a Job.

func ObserveFirstTaskCreation

func ObserveFirstTaskCreation(rj *execution.Job, task tasks.Task)

ObserveFirstTaskCreation records a metric for the first task creation time of a Job.

func UpdateJobStatusFromTaskRefs added in v0.1.0

func UpdateJobStatusFromTaskRefs(rj *execution.Job) (*execution.Job, error)

UpdateJobStatusFromTaskRefs returns a new Job after updating JobStatus from TaskRefs.

Types

type Context

type Context struct {
	controllercontext.Context
	// contains filtered or unexported fields
}

Context extends the common controllercontext.Context.

func NewContext

func NewContext(context controllercontext.Context) *Context

NewContext returns a new Context.

func NewContextWithRecorder added in v0.1.0

func NewContextWithRecorder(context controllercontext.Context, recorder record.EventRecorder) *Context

NewContextWithRecorder returns a new Context with a custom EventRecorder.

func (*Context) GetHasSynced added in v0.1.0

func (c *Context) GetHasSynced() []cache.InformerSynced

type Controller

type Controller struct {
	*Context
	// contains filtered or unexported fields
}

Controller is responsible for reconciling Jobs with their downstream task executor states.

func NewController

func NewController(
	ctrlContext controllercontext.Context,
	concurrency *configv1alpha1.Concurrency,
) (*Controller, error)

func (*Controller) GetHealth

func (c *Controller) GetHealth() controllermanager.HealthStatus

func (*Controller) Run

func (c *Controller) Run(ctx context.Context) error

func (*Controller) Shutdown

func (c *Controller) Shutdown(ctx context.Context)

type ExecutionControl

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

ExecutionControl is a wrapper around the Execution clientset.

func (*ExecutionControl) DeleteJob

func (*ExecutionControl) UpdateJob

func (c *ExecutionControl) UpdateJob(ctx context.Context, rj, newRj *execution.Job) (bool, error)

func (*ExecutionControl) UpdateJobStatus

func (c *ExecutionControl) UpdateJobStatus(ctx context.Context, rj, newRj *execution.Job) (bool, error)

type Factory

type Factory struct{}

func NewFactory

func NewFactory() *Factory

func (*Factory) Name

func (f *Factory) Name() string

func (*Factory) New

type InformerWorker

type InformerWorker struct {
	*Context
}

InformerWorker receives events from the informer and enqueues work to be done for the controller.

func NewInformerWorker

func NewInformerWorker(ctrlContext *Context) *InformerWorker

func (*InformerWorker) WorkerName

func (w *InformerWorker) WorkerName() string

type Reconciler

type Reconciler struct {
	*Context
	// contains filtered or unexported fields
}

func NewReconciler

func NewReconciler(ctrlContext *Context, concurrency *configv1alpha1.Concurrency) *Reconciler

func (*Reconciler) Concurrency

func (w *Reconciler) Concurrency() int

func (*Reconciler) MaxRequeues

func (w *Reconciler) MaxRequeues() int

func (*Reconciler) Name

func (w *Reconciler) Name() string

func (*Reconciler) SyncOne

func (w *Reconciler) SyncOne(ctx context.Context, namespace, name string, _ int) error

Jump to

Keyboard shortcuts

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