syncer

package
v0.0.0-...-f60eec5 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartSyncer

func StartSyncer(ctx context.Context, cfg *SyncerConfig, numSyncerThreads int) error

Types

type Controller

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

func New

func New(syncerName string, fromClient, toClient dynamic.Interface, fromConfig *rest.Config, direction SyncDirection) (*Controller, error)

New returns a new syncer Controller syncing spec from "from" to "to".

func NewSpecSyncer

func NewSpecSyncer(syncerName string, from, to *rest.Config) (*Controller, error)

func NewStatusSyncer

func NewStatusSyncer(syncerName string, from, to *rest.Config) (*Controller, error)

func (*Controller) AddToQueue

func (c *Controller) AddToQueue(gvr schema.GroupVersionResource, obj interface{})

func (*Controller) Start

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

Start starts N worker processes processing work items.

type DeleteFunc

type DeleteFunc func(ctx context.Context, gvr schema.GroupVersionResource, namespace, name string) error

type SyncDirection

type SyncDirection string

SyncDirection indicates which direction data is flowing for this particular syncer

const (

	// SyncDown indicates a syncer watches resources on the global hub and applies the spec to the leaf cluster
	SyncDown SyncDirection = "down"

	// SyncUp indicates a syncer watches resources on the leaft cluster and applies the status to the global hub
	SyncUp SyncDirection = "up"

	// if the Global Hub resources with this label, it means the resources is ready to be syncDown
	GlobalHubPolicyNamespaceLabel = "global-hub.open-cluster-management.io/original-namespace"
)

type SyncerConfig

type SyncerConfig struct {
	UpstreamConfig   *rest.Config
	DownstreamConfig *rest.Config
	SyncerName       string
}

SyncerConfig defines the syncer configuration that is guaranteed to vary across syncer deployments.

type UpsertFunc

type UpsertFunc func(ctx context.Context, gvr schema.GroupVersionResource, namespace string, unstrob *unstructured.Unstructured) error

Jump to

Keyboard shortcuts

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