resourcewatcher

package
v0.9.0-branch-757 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 23 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

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

	// ClusterResourcePlacementControllerV1Beta1 maintains a rate limited queue which is used to store
	// the name of the changed v1beta1 clusterResourcePlacement and a reconcile function to consume the items in queue.
	//
	// Note that the v1beta1 controller, different from the v1alpha1 controller, features its own set of
	// watchers and does not rely on this struct to detect changes.
	ClusterResourcePlacementControllerV1Beta1 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.
	// This controller will be used by both v1alpha1 & v1beta1 ClusterResourcePlacementController.
	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.
	// This controller is used by v1alpha1 ClusterResourcePlacementController only.
	// For v1beta1 ClusterResourcePlacement, the scheduler will watch the member cluster changes directly.
	MemberClusterPlacementController controller.Controller

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

	// ResourceConfig contains all the API resources that we won't select based on the allowed or skipped propagating APIs option.
	ResourceConfig *utils.ResourceConfig

	// 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