v1

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 21 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJobHandlerToHandler

func FromJobHandlerToHandler(sync JobHandler) generic.Handler

func RegisterJobGeneratingHandler

func RegisterJobGeneratingHandler(ctx context.Context, controller JobController, apply apply.Apply,
	condition condition.Cond, name string, handler JobGeneratingHandler, opts *generic.GeneratingHandlerOptions)

RegisterJobGeneratingHandler configures a JobController to execute a JobGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func RegisterJobStatusHandler

func RegisterJobStatusHandler(ctx context.Context, controller JobController, condition condition.Cond, name string, handler JobStatusHandler)

RegisterJobStatusHandler configures a JobController to execute a JobStatusHandler for every events observed. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func UpdateJobDeepCopyOnChange

func UpdateJobDeepCopyOnChange(client JobClient, obj *v1.Job, handler func(obj *v1.Job) (*v1.Job, error)) (*v1.Job, error)

Types

type Interface

type Interface interface {
	Job() JobController
}

func New

func New(controllerFactory controller.SharedControllerFactory) Interface

type JobCache

type JobCache interface {
	Get(namespace, name string) (*v1.Job, error)
	List(namespace string, selector labels.Selector) ([]*v1.Job, error)

	AddIndexer(indexName string, indexer JobIndexer)
	GetByIndex(indexName, key string) ([]*v1.Job, error)
}

type JobClient

type JobClient interface {
	Create(*v1.Job) (*v1.Job, error)
	Update(*v1.Job) (*v1.Job, error)
	UpdateStatus(*v1.Job) (*v1.Job, error)
	Delete(namespace, name string, options *metav1.DeleteOptions) error
	Get(namespace, name string, options metav1.GetOptions) (*v1.Job, error)
	List(namespace string, opts metav1.ListOptions) (*v1.JobList, error)
	Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)
	Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error)
}

type JobController

type JobController interface {
	generic.ControllerMeta
	JobClient

	OnChange(ctx context.Context, name string, sync JobHandler)
	OnRemove(ctx context.Context, name string, sync JobHandler)
	Enqueue(namespace, name string)
	EnqueueAfter(namespace, name string, duration time.Duration)

	Cache() JobCache
}

func NewJobController

func NewJobController(gvk schema.GroupVersionKind, resource string, namespaced bool, controller controller.SharedControllerFactory) JobController

type JobGeneratingHandler

type JobGeneratingHandler func(obj *v1.Job, status v1.JobStatus) ([]runtime.Object, v1.JobStatus, error)

JobGeneratingHandler is the top-level handler that is executed for every Job event. It extends JobStatusHandler by a returning a slice of child objects to be passed to apply.Apply

type JobHandler

type JobHandler func(string, *v1.Job) (*v1.Job, error)

type JobIndexer

type JobIndexer func(obj *v1.Job) ([]string, error)

type JobStatusHandler

type JobStatusHandler func(obj *v1.Job, status v1.JobStatus) (v1.JobStatus, error)

JobStatusHandler is executed for every added or modified Job. Should return the new status to be updated

Jump to

Keyboard shortcuts

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