replication

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 39 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	AnnotationKeyOriginalResourceVersion = "cache.kcp.io/original-resource-version"
	AnnotationKeyOriginalResourceUID     = "cache.kcp.io/original-resource-UID"
)
View Source
const (
	// ByShardAndLogicalClusterAndNamespaceAndName is the name for the index that indexes by an object's shard and logical cluster, namespace and name.
	ByShardAndLogicalClusterAndNamespaceAndName = "kcp-byShardAndLogicalClusterAndNamespaceAndName"
)
View Source
const (
	// ControllerName hold this controller name.
	ControllerName = "kcp-replication-controller"
)

Variables

This section is empty.

Functions

func IndexByShardAndLogicalClusterAndNamespace

func IndexByShardAndLogicalClusterAndNamespace(obj interface{}) ([]string, error)

IndexByShardAndLogicalClusterAndNamespace is an index function that indexes by an object's shard and logical cluster, namespace and name.

func InstallIndexers added in v0.25.0

InstallIndexers adds the additional indexers that this controller requires to the informers.

func IsNoSystemClusterName added in v0.11.0

func IsNoSystemClusterName(obj interface{}) bool

func NewController

func NewController(
	shardName string,
	dynamicCacheClient kcpdynamic.ClusterInterface,
	dynamicLocalClient kcpdynamic.ClusterInterface,
	gvrs map[schema.GroupVersionResource]ReplicatedGVR,
) (*controller, error)

NewController returns a new replication controller.

The replicated object will be placed under the same cluster as the original object. In addition to that, all replicated objects will be placed under the shard taken from the shardName argument. For example: shards/{shardName}/clusters/{clusterName}/apis/apis.kcp.io/v1alpha1/apiexports.

func ShardAndLogicalClusterAndNamespaceKey

func ShardAndLogicalClusterAndNamespaceKey(shard string, cluster logicalcluster.Name, namespace, name string) string

ShardAndLogicalClusterAndNamespaceKey creates an index key from the given parameters. As of today this function is used by IndexByShardAndLogicalClusterAndNamespace indexer.

Types

type ReplicatedGVR added in v0.25.0

type ReplicatedGVR struct {
	Kind   string
	Filter func(u *unstructured.Unstructured) bool
	// EventFilter overrides the default IsNoSystemClusterName event filter
	// for this resource, e.g. to replicate objects living in a system logical
	// cluster.
	EventFilter func(obj interface{}) bool
	// CacheOwnedFields lists field paths owned by the cache copy: they carry
	// admin intent written through the Admin workspace and are applied
	// cache -> local instead of being overwritten local -> cache. Each path is
	// a slice of literal field names, so keys that themselves contain dots -
	// annotation keys - address correctly.
	CacheOwnedFields [][]string
	Global, Local    cache.SharedIndexInformer
}

Jump to

Keyboard shortcuts

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