Documentation
¶
Index ¶
Constants ¶
View Source
const MinInterval = 1 * time.Millisecond
MinInterval is the minimum allowed interval for task runners to prevent panics from time.NewTicker(0).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct {
// The kubernetes client to use.
Client client.Client
// The interval at which to run the task.
Interval time.Duration
// The name of the task.
Name string
// If set, this function is called once at the start of the runner.
Init func(ctx context.Context) error
// If set, this function is called on each task run.
Run func(ctx context.Context) error
// contains filtered or unexported fields
}
Runner is a generic task runner that can be used to run periodic tasks in the controller-runtime manager. The runner acts as a controller that watches for generic events and triggers the task run on each event. In this way, it is properly integrated with the manager lifecycle and can leverage the controller-runtime features.
func (*Runner) SetupWithManager ¶
SetupWithManager sets up the task runner with the controller-runtime manager.
Click to show internal directories.
Click to hide internal directories.