resourcesync

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

controller is a control loop that watches synctarget. It starts/stops spec syncer and status syncer per gvr based on synctarget.Status.SyncedResources. All the spec/status syncer share the same downstreamNSInformer and upstreamSecretInformer. Informers for gvr is started separated for each syncer.

func (*Controller) AddDownstreamEventHandler

func (c *Controller) AddDownstreamEventHandler(handler ResourceEventHandlerPerGVR)

func (*Controller) AddUpstreamEventHandler

func (c *Controller) AddUpstreamEventHandler(handler ResourceEventHandlerPerGVR)

func (*Controller) InformerForResource

func (c *Controller) InformerForResource(gvr schema.GroupVersionResource) (*SyncerInformer, bool)

func (*Controller) Start

func (c *Controller) Start(ctx context.Context, numThreads int)

Start starts the controller workers.

type SyncerInformer

type SyncerInformer struct {
	UpstreamInformer   informers.GenericInformer
	DownstreamInformer informers.GenericInformer
	// contains filtered or unexported fields
}

type SyncerInformerFactory

type SyncerInformerFactory interface {
	AddUpstreamEventHandler(handler ResourceEventHandlerPerGVR)
	AddDownstreamEventHandler(handler ResourceEventHandlerPerGVR)
	InformerForResource(gvr schema.GroupVersionResource) (*SyncerInformer, bool)
	Start(ctx context.Context, numThreads int)
}

func NewController

func NewController(
	upstreamDynamicClusterClient *dynamic.Cluster,
	downstreamDynamicClient dynamic.Interface,
	downstreamKubeClient kubernetes.Interface,
	kcpClusterClient *kcpclient.Cluster,
	syncTargetInformer workloadinformers.SyncTargetInformer,
	syncTargetName string,
	syncTargetWorkspace logicalcluster.Name,
	syncTargetUID types.UID,
) (SyncerInformerFactory, error)

Jump to

Keyboard shortcuts

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