syncer

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: Apache-2.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdvancedSchedulingFeatureAnnotation = "featuregates.experimental.workload.kcp.io/advancedscheduling"
)
View Source
const GVRForLocationIndexName = "GVRForLocation"
View Source
const LocationIndexName = "Location"

Variables

This section is empty.

Functions

func GetGVRForLocationIndexKey

func GetGVRForLocationIndexKey(location string, gvr metav1.GroupVersionResource) string

func GetLocationIndexKey

func GetLocationIndexKey(location string) string

func StartHeartbeat

func StartHeartbeat(ctx context.Context, tmcSyncTargetClient tmcclientset.Interface, syncTargetName, syncTargetUID string)

func StartSyncer

func StartSyncer(ctx context.Context, cfg *SyncerConfig, numSyncerThreads int, importPollInterval time.Duration, syncerNamespace string) error

func StartSyncerTunnel

func StartSyncerTunnel(ctx context.Context, upstream, downstream *rest.Config, syncTargetWorkspace logicalcluster.Name, syncTargetName, syncTargetUID string, getDownstreamLister ResourceListerFunc)

StartSyncerTunnel blocks until the context is cancelled trying to establish a tunnel against the specified target.

Types

type APIImporter

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

func NewAPIImporter

func NewAPIImporter(
	upstreamConfig, downstreamConfig *rest.Config,
	synctargetInformer workloadinformers.SyncTargetInformer,
	apiImportInformer apiresourceinformer.APIResourceImportInformer,
	resourcesToSync []string,
	syncTargetPath logicalcluster.Path,
	syncTargetName string,
	syncTargetUID types.UID,
) (*APIImporter, error)

func (*APIImporter) ImportAPIs

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

func (*APIImporter) Start

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

func (*APIImporter) Stop

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

type ResourceListerFunc

type ResourceListerFunc func(gvr schema.GroupVersionResource) (cache.GenericLister, error)

type SyncerConfig

type SyncerConfig struct {
	UpstreamConfig                *rest.Config
	DownstreamConfig              *rest.Config
	ResourcesToSync               sets.Set[string]
	SyncTargetPath                logicalcluster.Path
	SyncTargetName                string
	SyncTargetUID                 string
	DownstreamNamespaceCleanDelay time.Duration
	DNSImage                      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.

Directories

Path Synopsis
dns

Jump to

Keyboard shortcuts

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