Documentation ¶
Overview ¶
Package runnables provides helper types for creating runnables for the controller-runtime manager when leader election is enabled.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CronJob ¶
type CronJob struct {
// contains filtered or unexported fields
}
CronJob periodically runs a worker function.
type CronJobConfig ¶
type CronJobConfig struct { // Worker is the function that will be run for every cronjob iteration. Worker func(context.Context) // ReadyCh delays the start of the job until the channel is closed. ReadyCh <-chan struct{} // Logger is the logger. Logger logr.Logger // Period defines the period of the cronjob. The cronjob will run every Period. Period time.Duration // JitterFactor sets the jitter for the cronjob. If positive, the period is jittered before every // run of the worker. If jitterFactor is not positive, the period is unchanged and not jittered. JitterFactor float64 }
CronJobConfig is the configuration for a cronjob.
type EnableAfterBecameLeader ¶
type EnableAfterBecameLeader struct {
// contains filtered or unexported fields
}
EnableAfterBecameLeader is a Runnable that will call the enable function when the current instance becomes the leader.
func NewEnableAfterBecameLeader ¶
func NewEnableAfterBecameLeader(enable func(context.Context)) *EnableAfterBecameLeader
NewEnableAfterBecameLeader creates a new EnableAfterBecameLeader Runnable.
func (*EnableAfterBecameLeader) NeedLeaderElection ¶
func (j *EnableAfterBecameLeader) NeedLeaderElection() bool
type Leader ¶
Leader is a Runnable that needs to be run only when the current instance is the leader.
func (*Leader) NeedLeaderElection ¶
type LeaderOrNonLeader ¶
LeaderOrNonLeader is a Runnable that needs to be run regardless of whether the current instance is the leader.
func (*LeaderOrNonLeader) NeedLeaderElection ¶
func (r *LeaderOrNonLeader) NeedLeaderElection() bool
Click to show internal directories.
Click to hide internal directories.