upsync

package
v0.20.0-rc2 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: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceVersionAnnotation is an annotation set on a resource upsynced upstream
	// that contains the resourceVersion of the corresponding downstream resource
	// when it was last upsynced.
	// It is used to check easily, without having to compare the resource contents,
	// whether an upsynced upstream resource is up-to-date with the downstream resource.
	ResourceVersionAnnotation = "workload.kcp.io/rv"
)

Variables

This section is empty.

Functions

func NewUpSyncer

func NewUpSyncer(syncerLogger logr.Logger, syncTargetClusterName logicalcluster.Name,
	syncTargetName, syncTargetKey string,
	getShardAccess synctarget.GetShardAccessFunc, downstreamClient dynamic.Interface,
	ddsifForDownstream *ddsif.GenericDiscoveringDynamicSharedInformerFactory[cache.SharedIndexInformer, cache.GenericLister, informers.GenericInformer],
	syncTargetUID types.UID) (*controller, error)

NewUpSyncer returns a new controller which upsyncs, through the Upsyncer virtual workspace, downstream resources which are part of the upsyncable resource types (fixed limited list for now), and provide the following labels:

  • internal.workload.kcp.io/cluster: <sync target key>
  • state.workload.kcp.io/<sync target key>: Upsync

and optionally, for cluster-wide resources, the `kcp.io/namespace-locator` annotation filled with the information necessary identify the upstream workspace to upsync to.

func NewUpSyncerCleanupController

func NewUpSyncerCleanupController(syncerLogger logr.Logger, syncTargetClusterName logicalcluster.Name,
	syncTargetName string, syncTargetUID types.UID, syncTargetKey string,
	upstreamClusterClient kcpdynamic.ClusterInterface,
	ddsifForUpstreamUpsyncer *ddsif.DiscoveringDynamicSharedInformerFactory,
	ddsifForDownstream *ddsif.GenericDiscoveringDynamicSharedInformerFactory[cache.SharedIndexInformer, cache.GenericLister, informers.GenericInformer],
) (*cleanupController, error)

NewUpSyncerCleanupController returns a new controller which will cleanup any upsynced upstream resource if the corresponding downstream resources doesn't exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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