resourcewatcher

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeDetector

type ChangeDetector struct {
	// DiscoveryClient is used to do resource discovery.
	DiscoveryClient *discovery.DiscoveryClient

	// RESTMapper is used to convert between GVK and GVR
	RESTMapper meta.RESTMapper

	// ClusterResourcePlacementController maintains a rate limited queue which is used to store
	// the name of the changed clusterResourcePlacement and a reconcile function to consume the items in queue.
	ClusterResourcePlacementController controller.Controller

	// ClusterResourcePlacementController maintains a rate limited queue which is used to store any resources'
	// cluster wide key and a reconcile function to consume the items in queue.
	ResourceChangeController controller.Controller

	// MemberClusterPlacementController maintains a rate limited queue which is used to store
	// the name of the changed memberCluster and a reconcile function to consume the items in queue.
	MemberClusterPlacementController controller.Controller

	// InformerManager manages all the dynamic informers created by the discovery client
	InformerManager utils.InformerManager

	// DisabledResourceConfig contains all the api resources that we won't select
	DisabledResourceConfig *utils.DisabledResourceConfig

	// SkippedNamespaces contains all the namespaces that we won't select
	SkippedNamespaces map[string]bool

	// ConcurrentClusterPlacementWorker is the number of cluster `placement` reconcilers that are
	// allowed to sync concurrently.
	ConcurrentClusterPlacementWorker int

	// ConcurrentResourceChangeWorker is the number of resource change work that are
	// allowed to sync concurrently.
	ConcurrentResourceChangeWorker int
}

ChangeDetector is a resource watcher which watches all types of resources in the cluster and reconcile the events.

func (*ChangeDetector) NeedLeaderElection

func (d *ChangeDetector) NeedLeaderElection() bool

NeedLeaderElection implements LeaderElectionRunnable interface. So that the detector could run in the leader election mode.

func (*ChangeDetector) Start

func (d *ChangeDetector) Start(ctx context.Context) error

Start runs the detector, never stop until stopCh closed. This is called by the controller manager.

Jump to

Keyboard shortcuts

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