replication

package
v0.29.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ByGVRAndShardAndLogicalClusterAndNamespaceAndName is the name for the index that indexes by an object's gvr, shard and logical cluster, namespace and name.
	ByGVRAndShardAndLogicalClusterAndNamespaceAndName = "kcp-byGVRAndShardAndLogicalClusterAndNamespaceAndName"

	// ByGVRAndLogicalClusterAndNamespace is the name for the index that indexes by an object's gvr, logical cluster and namespace.
	ByGVRAndLogicalClusterAndNamespace = "kcp-byGVRAndLogicalClusterAndNamespace"
)
View Source
const (
	LabelKeyObjectSchema                 = "cache.kcp.io/object-schema"
	LabelKeyObjectGroup                  = "cache.kcp.io/object-group"
	LabelKeyObjectVersion                = "cache.kcp.io/object-version"
	LabelKeyObjectResource               = "cache.kcp.io/object-resource"
	LabelKeyObjectOriginalName           = "cache.kcp.io/object-original-name"
	LabelKeyObjectOriginalNamespace      = "cache.kcp.io/object-original-namespace"
	AnnotationKeyOriginalResourceVersion = "cache.kcp.io/original-resource-version"
	AnnotationKeyOriginalResourceUID     = "cache.kcp.io/original-resource-UID"
)
View Source
const (
	// ControllerName hold this controller name.
	ControllerName = "kcp-published-resource-replication-controller"
)

Variables

This section is empty.

Functions

func GVRAndLogicalClusterAndNamespace

func GVRAndLogicalClusterAndNamespace(gvr schema.GroupVersionResource, cluster logicalcluster.Name, namespace string) string

GVRAndLogicalClusterAndNamespace creates an index key from the given parameters.

func GVRAndShardAndLogicalClusterAndNamespaceKey

func GVRAndShardAndLogicalClusterAndNamespaceKey(gvr schema.GroupVersionResource, shard string, cluster logicalcluster.Name, namespace, name string) string

GVRAndShardAndLogicalClusterAndNamespaceKey creates an index key from the given parameters. As of today this function is used by IndexByShardAndLogicalClusterAndNamespace indexer. Key will be in the form of version.resource.group|shard|cluster|namespace/name.

func GenCachedObjectName

func GenCachedObjectName(gvr schema.GroupVersionResource, namespace, name string) string

func IndexByGVRAndLogicalClusterAndNamespace

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

IndexByGVRAndLogicalClusterAndNamespace is an index function that indexes by wrapped object's GVR, logical cluster and namespace.

func IndexByGVRAndShardAndLogicalClusterAndNamespace

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

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

func InstallIndexers

func InstallIndexers(replicated *ReplicatedGVR)

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

Types

type Controller

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

func NewController

func NewController(
	shardName string,
	dynamicClusterClient kcpdynamic.ClusterInterface,
	kcpCacheClient kcpclientset.ClusterInterface,
	cluster logicalcluster.Name,
	gvr schema.GroupVersionResource,
	replicated *ReplicatedGVR,
	callback func(),
	localLabelSelector labels.Selector,
) (*Controller, error)

NewController returns a new replication controller.

func (*Controller) SetDeleted

func (c *Controller) SetDeleted(ctx context.Context)

func (*Controller) SetLabelSelector

func (c *Controller) SetLabelSelector(localLabelSelector labels.Selector)

func (*Controller) Start

func (c *Controller) Start(ctx context.Context, workers int)

Start starts the controller, which stops when ctx.Done() is closed.

func (*Controller) Started

func (c *Controller) Started() bool

type ReplicatedGVR

type ReplicatedGVR struct {
	Kind          string
	Filter        func(u *unstructured.Unstructured) bool
	Global, Local cache.SharedIndexInformer
}

Jump to

Keyboard shortcuts

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