syncer

package
v0.3.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncerNamespaceKey = "SYNCER_NAMESPACE"
)

Variables

This section is empty.

Functions

func PhysicalClusterNamespaceName

func PhysicalClusterNamespaceName(l NamespaceLocator) (string, error)

PhysicalClusterNamespaceName encodes the NamespaceLocator to a new namespace name for use on a physical cluster. The encoding is repeatable.

func StartSyncer

func StartSyncer(ctx context.Context, upstream, downstream *rest.Config, resources sets.String, kcpClusterName logicalcluster.LogicalCluster, pcluster string, numSyncerThreads int) error

Types

type Controller

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

func New

func New(kcpClusterName logicalcluster.LogicalCluster, pcluster string, fromDiscovery discovery.DiscoveryInterface, fromClient, toClient dynamic.Interface, direction SyncDirection, syncedResourceTypes []string, pclusterID string, mutators mutatorGvrMap) (*Controller, error)

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

func NewSpecSyncer

func NewSpecSyncer(from, to *rest.Config, syncedResourceTypes []string, kcpClusterName logicalcluster.LogicalCluster, pclusterID string) (*Controller, error)

func NewStatusSyncer

func NewStatusSyncer(from, to *rest.Config, syncedResourceTypes []string, kcpClusterName logicalcluster.LogicalCluster, pclusterID string) (*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 NamespaceLocator

type NamespaceLocator struct {
	LogicalCluster logicalcluster.LogicalCluster `json:"logical-cluster"`
	Namespace      string                        `json:"namespace"`
}

NamespaceLocator stores a logical cluster and namespace and is used as the source for the mapped namespace name in a physical cluster.

type SyncDirection

type SyncDirection string

SyncDirection indicates which direction data is flowing for this particular syncer

const SyncDown SyncDirection = "down"

SyncDown indicates a syncer watches resources on KCP and applies the spec to the target cluster

const SyncUp SyncDirection = "up"

SyncUp indicates a syncer watches resources on the target cluster and applies the status to KCP

type UpsertFunc

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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