jobqueuecontroller

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: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 processing all Jobs to determine if they can be started, and if so, starts them in a deterministic order and safe from race conditions.

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 Factory

type Factory struct{}

func NewFactory

func NewFactory() *Factory

func (*Factory) Name

func (f *Factory) Name() string

func (*Factory) New

type IndependentReconciler

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

IndependentReconciler reconciles independent Jobs that do not have any JobConfig.

func NewIndependentReconciler

func NewIndependentReconciler(
	ctrlContext *Context,
	concurrency *configv1alpha1.Concurrency,
	client JobControlInterface,
) *IndependentReconciler

func (*IndependentReconciler) Concurrency

func (r *IndependentReconciler) Concurrency() int

func (*IndependentReconciler) MaxRequeues

func (r *IndependentReconciler) MaxRequeues() int

func (*IndependentReconciler) Name

func (r *IndependentReconciler) Name() string

func (*IndependentReconciler) SyncOne

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

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 JobControl

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

JobControl is the default implementation of JobControlInterface.

func (*JobControl) RejectJob

func (c *JobControl) RejectJob(ctx context.Context, rj *execution.Job, msg string) error

func (*JobControl) StartJob

func (c *JobControl) StartJob(ctx context.Context, rj *execution.Job) error

StartJob sets the startTime of the Job to the current time.

type JobControlInterface

type JobControlInterface interface {
	StartJob(ctx context.Context, rj *execution.Job) error
	RejectJob(ctx context.Context, rj *execution.Job, msg string) error
}

JobControlInterface is the client interface for the Controller.

type PerConfigReconciler

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

PerConfigReconciler reconciles Jobs belonging to a JobConfig. It is guaranteed that no two routines will process Jobs belonging to the same JobConfig.

func NewPerConfigReconciler

func NewPerConfigReconciler(
	ctrlContext *Context,
	concurrency *configv1alpha1.Concurrency,
	client JobControlInterface,
) *PerConfigReconciler

func (*PerConfigReconciler) Concurrency

func (w *PerConfigReconciler) Concurrency() int

func (*PerConfigReconciler) MaxRequeues

func (w *PerConfigReconciler) MaxRequeues() int

func (*PerConfigReconciler) Name

func (w *PerConfigReconciler) Name() string

func (*PerConfigReconciler) SyncOne

func (w *PerConfigReconciler) 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