Documentation
¶
Index ¶
- Constants
- func GVRAndLogicalClusterAndNamespace(gvr schema.GroupVersionResource, cluster logicalcluster.Name, namespace string) string
- func GVRAndShardAndLogicalClusterAndNamespaceKey(gvr schema.GroupVersionResource, shard string, cluster logicalcluster.Name, ...) string
- func GenCachedObjectName(gvr schema.GroupVersionResource, namespace, name string) string
- func IndexByGVRAndLogicalClusterAndNamespace(obj interface{}) ([]string, error)
- func IndexByGVRAndShardAndLogicalClusterAndNamespace(obj interface{}) ([]string, error)
- func InstallIndexers(replicated *ReplicatedGVR)
- type Controller
- type ReplicatedGVR
Constants ¶
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" )
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" )
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 ¶
IndexByGVRAndLogicalClusterAndNamespace is an index function that indexes by wrapped object's GVR, logical cluster and namespace.
func IndexByGVRAndShardAndLogicalClusterAndNamespace ¶
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
}