syncer

package
v0.5.9-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiClusterSyncManager

type MultiClusterSyncManager interface {
	Create(ctx context.Context, clusterName string, config *rest.Config) (SingleClusterSyncManager, error)
	Start(ctx context.Context, clusterName string) error
	Stop(ctx context.Context, clusterName string)
	GetForCluster(clusterName string) (SingleClusterSyncManager, bool)
}

MultiClusterSyncManager defines the interface for synchronizing across multiple clusters.

func NewMultiClusterSyncManager

func NewMultiClusterSyncManager(baseContext context.Context, controller controller.Controller, storage storage.ResourceStorage) MultiClusterSyncManager

NewMultiClusterSyncManager creates a new MultiClusterSyncManager instance with the given context, controller and storage.

type ResourceSyncer

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

ResourceSyncer is the main struct that holds the necessary fields and methods for the resource syncer component.

func NewResourceSyncer

func NewResourceSyncer(cluster string, dynamicClient dynamic.Interface, rsr v1beta1.ResourceSyncRule, storage storage.ResourceStorage) *ResourceSyncer

NewResourceSyncer creates a new instance of the ResourceSyncer with the given parameters.

func (*ResourceSyncer) OnAdd

func (s *ResourceSyncer) OnAdd(obj client.Object)

OnAdd handles the addition of a Kubernetes object.

func (*ResourceSyncer) OnDelete

func (s *ResourceSyncer) OnDelete(obj client.Object)

OnDelete handles the deletion of a Kubernetes object.

func (*ResourceSyncer) OnGeneric

func (s *ResourceSyncer) OnGeneric(obj client.Object)

OnGeneric handles generic events for a Kubernetes object.

func (*ResourceSyncer) OnUpdate

func (s *ResourceSyncer) OnUpdate(obj client.Object)

OnUpdate handles updates to a Kubernetes object.

func (*ResourceSyncer) Run

func (s *ResourceSyncer) Run(ctx context.Context) error

Run starts the ResourceSyncer and its workers to process Kubernetes object events.

func (*ResourceSyncer) Source

func (s *ResourceSyncer) Source() SyncSource

Source returns the SyncSource associated with the ResourceSyncer.

func (*ResourceSyncer) Stop

func (s *ResourceSyncer) Stop(ctx context.Context) error

Stop stops the ResourceSyncer and cleans up resources.

func (*ResourceSyncer) SyncRule

func (s *ResourceSyncer) SyncRule() v1beta1.ResourceSyncRule

SyncRule returns the ResourceSyncRule associated with the ResourceSyncer.

type SingleClusterSyncManager

type SingleClusterSyncManager interface {
	Start(context.Context) error
	Started() bool
	Stop(context.Context)
	Stopped() bool
	UpdateSyncResources(context.Context, []*searchv1beta1.ResourceSyncRule) error
	HasSyncResource(schema.GroupVersionResource) bool
	ClusterConfig() *rest.Config
}

SingleClusterSyncManager defines the interface for managing synchronization of resources across a single cluster.

func NewSingleClusterSyncManager

func NewSingleClusterSyncManager(baseContext context.Context,
	clusterName string,
	config *rest.Config,
	controller controller.Controller,
	storage storage.ResourceStorage,
) (SingleClusterSyncManager, error)

NewSingleClusterSyncManager creates a new instance of the singleClusterSyncManager with the given context, cluster name, config, controller, and storage.

type SyncReconciler

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

SyncReconciler is the main structure that holds the state and dependencies for the multi-cluster syncer reconciler.

func NewSyncReconciler

func NewSyncReconciler(storage storage.ResourceStorage) *SyncReconciler

NewSyncReconciler creates a new instance of the SyncReconciler structure with the given storage.

func (*SyncReconciler) CreateEvent

CreateEvent handles the creation event for a resource and enqueues it for reconciliation.

func (*SyncReconciler) DeleteEvent

DeleteEvent handles the deletion event for a resource and enqueues it for reconciliation.

func (*SyncReconciler) Reconcile

Reconcile is the main entry point for the syncer reconciler, which is called whenever there is a change in the watched resources.

func (*SyncReconciler) SetupWithManager

func (r *SyncReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the SyncReconciler with the given manager and registers it as a controller.

func (*SyncReconciler) UpdateEvent

UpdateEvent handles the update event for a resource and enqueues it for reconciliation.

type SyncSource

type SyncSource interface {
	source.Source
	clientgocache.Store
	Cluster() string
	SyncRule() v1beta1.ResourceSyncRule
	Stop(context.Context) error
	HasSynced() bool
}

SyncSource defines the interface for sources that can be synced, including methods for interacting with the Kubernetes API and cache.

func NewSource

func NewSource(cluster string, client dynamic.Interface, rsr v1beta1.ResourceSyncRule, storage storage.ResourceStorage) SyncSource

NewSource creates a new instance of informerSource with the provided parameters, including cluster name, Kubernetes client, sync rule, and storage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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