handler

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScheduleHourlyRandom   = "@hourly-random"
	ScheduleDailyRandom    = "@daily-random"
	ScheduleYearlyRandom   = "@yearly-random"
	ScheduleAnnuallyRandom = "@annually-random"
	ScheduleMonthlyRandom  = "@monthly-random"
	ScheduleWeeklyRandom   = "@weekly-random"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	job.Config
}

Handler is the generic job handler for most of the k8up jobs.

func NewHandler

func NewHandler(config job.Config) *Handler

NewHandler will return a new generic handler.

func (*Handler) Handle

func (h *Handler) Handle() error

Handle checks if that job is started and will add it to the queue, if not.

type JobHandler

type JobHandler struct {
	job.Config
	// contains filtered or unexported fields
}

JobHandler handles the reconciles for the batchv1.job objects that are observed by the operator.

func NewJobHandler

func NewJobHandler(config job.Config, job *batchv1.Job) *JobHandler

NewJobHandler returns a new JobHandler.

func (*JobHandler) Handle

func (j *JobHandler) Handle() error

Handle extracts some information from the batchv1.job that make observations easier.

type ScheduleHandler

type ScheduleHandler struct {
	job.Config
	// contains filtered or unexported fields
}

ScheduleHandler handles the reconciles for the schedules. Schedules are a special type of k8up objects as they will only trigger jobs indirectly.

func NewScheduleHandler

func NewScheduleHandler(config job.Config, schedule *k8upv1alpha1.Schedule) *ScheduleHandler

NewScheduleHandler will return a new ScheduleHandler.

func (*ScheduleHandler) Handle

func (s *ScheduleHandler) Handle() error

Handle handles the schedule management. It's responsible for adding and removing the jobs from the internal cron library.

Jump to

Keyboard shortcuts

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