syncer

package
v0.4.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

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, cfg *SyncerConfig, numSyncerThreads int, importPollInterval time.Duration) error

Types

type APIImporter added in v0.6.0

type APIImporter struct {
	SyncedGVRs map[string]metav1.GroupVersionResource
	// contains filtered or unexported fields
}

func NewAPIImporter added in v0.6.0

func NewAPIImporter(
	upstreamConfig, downstreamConfig *rest.Config,
	resourcesToSync []string,
	logicalClusterName logicalcluster.LogicalCluster,
	location string,
) (*APIImporter, error)

func (*APIImporter) ImportAPIs added in v0.6.0

func (i *APIImporter) ImportAPIs(ctx context.Context)

func (*APIImporter) Start added in v0.6.0

func (i *APIImporter) Start(ctx context.Context, pollInterval time.Duration)

func (*APIImporter) Stop added in v0.6.0

func (i *APIImporter) Stop()

type Controller

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

func New

func New(kcpClusterName logicalcluster.LogicalCluster, pcluster string, fromClient, toClient dynamic.Interface, direction SyncDirection, gvrs []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, gvrs []string, kcpClusterName logicalcluster.LogicalCluster, pclusterID string) (*Controller, error)

func NewStatusSyncer

func NewStatusSyncer(from, to *rest.Config, gvrs []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.

func LocatorFromAnnotations

func LocatorFromAnnotations(annotations map[string]string) (*NamespaceLocator, error)

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 SyncerConfig added in v0.6.0

type SyncerConfig struct {
	UpstreamConfig      *rest.Config
	DownstreamConfig    *rest.Config
	ResourcesToSync     sets.String
	KCPClusterName      logicalcluster.LogicalCluster
	WorkloadClusterName string
}

SyncerConfig defines the syncer configuration that is guaranteed to vary across syncer deployments. Capturing these details in a struct simplifies defining these details in test fixture.

func (*SyncerConfig) ID

func (sc *SyncerConfig) ID() string

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