reconciler

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package reconciler implements interfaces that attempt to reconcile the desired state of the world with the actual state of the world by triggering relevant actions (register/deregister plugins).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reconciler

type Reconciler interface {
	// Run starts running the reconciliation loop which executes periodically,
	// checks if plugins are correctly registered or unregistered.
	// If not, it will trigger register/unregister operations to rectify.
	Run(stopCh <-chan struct{})

	// AddHandler adds the given plugin handler for a specific plugin type,
	// which will be added to the actual state of world cache.
	AddHandler(pluginType string, pluginHandler cache.PluginHandler)
}

Reconciler runs a periodic loop to reconcile the desired state of the world with the actual state of the world by triggering register and unregister operations. Also provides a means to add a handler for a plugin type.

func NewReconciler

func NewReconciler(
	operationExecutor operationexecutor.OperationExecutor,
	loopSleepDuration time.Duration,
	desiredStateOfWorld cache.DesiredStateOfWorld,
	actualStateOfWorld cache.ActualStateOfWorld) Reconciler

NewReconciler returns a new instance of Reconciler.

loopSleepDuration - the amount of time the reconciler loop sleeps between

successive executions
syncDuration - the amount of time the syncStates sleeps between
successive executions

operationExecutor - used to trigger register/unregister operations safely

(prevents more than one operation from being triggered on the same
socket path)

desiredStateOfWorld - cache containing the desired state of the world actualStateOfWorld - cache containing the actual state of the world

Jump to

Keyboard shortcuts

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