Documentation ¶
Index ¶
- func CreateOrUpdate(ctx context.Context, c client.Client, cj *batchv1.CronJob, equal EqualityFunc, ...) error
- func Delete(ctx context.Context, c client.Client, key client.ObjectKey) error
- func Equal(current, desired *batchv1.CronJob) bool
- func List(ctx context.Context, c client.Client, namespace string, ...) ([]batchv1.CronJob, error)
- func Mutate(current, desired *batchv1.CronJob)
- type Builder
- func (b *Builder) Build() *batchv1.CronJob
- func (b *Builder) WithBackoffLimit(l int32) *Builder
- func (b *Builder) WithConcurrencyPolicy(cp batchv1.ConcurrencyPolicy) *Builder
- func (b *Builder) WithFailedJobsHistoryLimit(l int32) *Builder
- func (b *Builder) WithParallelism(p int32) *Builder
- func (b *Builder) WithPodSpec(containerName string, spec *corev1.PodSpec) *Builder
- func (b *Builder) WithSchedule(s string) *Builder
- func (b *Builder) WithSuccessfulJobsHistoryLimit(l int32) *Builder
- func (b *Builder) WithSuspend(s bool) *Builder
- type EqualityFunc
- type MutateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, c client.Client, cj *batchv1.CronJob, equal EqualityFunc, mutate MutateFunc) error
CreateOrUpdate attempts first to get the given cronjob. If the cronjob does not exist, the cronjob will be created. Otherwise, if the cronjob exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder represents the type to build Cronjob objects
func (*Builder) WithBackoffLimit ¶
WithBackoffLimit sets the cronjob's job backoff limit
func (*Builder) WithConcurrencyPolicy ¶
func (b *Builder) WithConcurrencyPolicy(cp batchv1.ConcurrencyPolicy) *Builder
WithConcurrencyPolicy sets the concurrency policy for the cronjob
func (*Builder) WithFailedJobsHistoryLimit ¶
WithFailedJobsHistoryLimit sets the limit for the history of failed jobs
func (*Builder) WithParallelism ¶
WithParallelism sets the cronjob's job parallelism limit
func (*Builder) WithPodSpec ¶
WithPodSpec sets the cronjob pod spec and its name
func (*Builder) WithSchedule ¶
WithSchedule sets the cronjob's schedule
func (*Builder) WithSuccessfulJobsHistoryLimit ¶
WithSuccessfulJobsHistoryLimit sets the limit for the history of successful jobs
func (*Builder) WithSuspend ¶
WithSuspend sets the cronjob's suspend state
type EqualityFunc ¶
EqualityFunc is the type for functions that compare two cronjobs. Return true if two cronjobs are equal.
type MutateFunc ¶
MutateFunc is the type for functions that mutate the current cronjob by applying the values from the desired cronjob.