Documentation
¶
Index ¶
- type Controller
- func (c *Controller) AddDownstreamEventHandler(handler ResourceEventHandlerPerGVR)
- func (c *Controller) AddUpstreamEventHandler(handler ResourceEventHandlerPerGVR)
- func (c *Controller) InformerForResource(gvr schema.GroupVersionResource) (*SyncerInformer, bool)
- func (c *Controller) Start(ctx context.Context, numThreads int)
- func (c *Controller) SyncableGVRs() (map[schema.GroupVersionResource]*SyncerInformer, error)
- type ResourceEventHandlerPerGVR
- type SyncerInformer
- type SyncerInformerFactory
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.
func (*Controller) SyncableGVRs ¶ added in v0.10.0
func (c *Controller) SyncableGVRs() (map[schema.GroupVersionResource]*SyncerInformer, error)
type ResourceEventHandlerPerGVR ¶
type ResourceEventHandlerPerGVR func(schema.GroupVersionResource) cache.ResourceEventHandler
type SyncerInformer ¶
type SyncerInformer struct {
UpstreamInformer kcpkubernetesinformers.GenericClusterInformer
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)
SyncableGVRs() (map[schema.GroupVersionResource]*SyncerInformer, error)
Start(ctx context.Context, numThreads int)
}
func NewController ¶
func NewController( syncerLogger logr.Logger, upstreamDynamicClusterClient kcpdynamic.ClusterInterface, downstreamDynamicClient dynamic.Interface, downstreamKubeClient kubernetes.Interface, kcpClient clientset.Interface, syncTargetInformer workloadv1alpha1informers.SyncTargetInformer, syncTargetName string, syncTargetWorkspace logicalcluster.Name, syncTargetUID types.UID, ) (SyncerInformerFactory, error)
Click to show internal directories.
Click to hide internal directories.