resync

package
v0.0.0-...-5d90d19 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package resync helps controllers specify custom resync behavior, which is important when they need to check state that lives outside the Kubernetes API server, such as in an app-specific system.

The controller-runtime library supports a form of resync, but you have to use the same setting for all controllers in the controller manager, and it tends to dump everything in the queue at once, which is spiky.

This package allows each controller to set its own resync period, and tries to spread out the requeuing of objects over time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Periodic

type Periodic struct {
	// contains filtered or unexported fields
}

Periodic will trigger periodic resyncs of objects.

func NewPeriodic

func NewPeriodic(name string, period time.Duration) *Periodic

NewPeriodic returns a new periodic resync.

func (*Periodic) Enqueue

func (p *Periodic) Enqueue(objKey client.ObjectKey)

Enqueue adds the given object to the periodic resync queue. If the object was already in the queue, this resets the timer on it since it's assumed that this is called after a reconcile pass has just finished.

func (*Periodic) WatchSource

func (p *Periodic) WatchSource() source.Source

WatchSource returns the source.Source that can be passed to Controller.Watch() to plug this resync into the controller.

Jump to

Keyboard shortcuts

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