Documentation ¶
Index ¶
- Constants
- func IndexByShardAndLogicalClusterAndNamespace(obj interface{}) ([]string, error)
- func InstallIndexers(localKcpInformers kcpinformers.SharedInformerFactory, ...) map[schema.GroupVersionResource]ReplicatedGVR
- func IsNoSystemClusterName(obj interface{}) bool
- func NewController(shardName string, dynamicCacheClient kcpdynamic.ClusterInterface, ...) (*controller, error)
- func ShardAndLogicalClusterAndNamespaceKey(shard string, cluster logicalcluster.Name, namespace, name string) string
- type ReplicatedGVR
Constants ¶
const (
// ByShardAndLogicalClusterAndNamespaceAndName is the name for the index that indexes by an object's shard and logical cluster, namespace and name.
ByShardAndLogicalClusterAndNamespaceAndName = "kcp-byShardAndLogicalClusterAndNamespaceAndName"
)
const (
// ControllerName hold this controller name.
ControllerName = "kcp-replication-controller"
)
Variables ¶
This section is empty.
Functions ¶
func IndexByShardAndLogicalClusterAndNamespace ¶
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
func InstallIndexers( localKcpInformers kcpinformers.SharedInformerFactory, globalKcpInformers kcpinformers.SharedInformerFactory, localKubeInformers kcpkubernetesinformers.SharedInformerFactory, globalKubeInformers kcpkubernetesinformers.SharedInformerFactory) map[schema.GroupVersionResource]ReplicatedGVR
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, localKcpInformers kcpinformers.SharedInformerFactory, globalKcpInformers kcpinformers.SharedInformerFactory, localKubeInformers kcpkubernetesinformers.SharedInformerFactory, globalKubeInformers kcpkubernetesinformers.SharedInformerFactory, 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 Global, Local cache.SharedIndexInformer }