Documentation
¶
Index ¶
- Constants
- func GVRAndLogicalClusterKey(gvr schema.GroupVersionResource, cluster logicalcluster.Name) string
- func GenerateIdentitySecret(ctx context.Context, ns string, name string) (*corev1.Secret, error)
- func GroupResourceKey(gr schema.GroupResource) string
- func IdentityAndGroupResourceKey(identity string, gr schema.GroupResource) string
- func IndexByGVRAndLogicalCluster(obj interface{}) ([]string, error)
- func IndexByGroupResource(obj interface{}) ([]string, error)
- func IndexByIdentityAndGroupResource(obj interface{}) ([]string, error)
- type ClusterCachedResourceResource
- type Controller
Constants ¶
const ( ControllerName = "kcp-cluster-cached-resources-controller" DefaultIdentitySecretNamespace = "kcp-system" )
This Controller starts 1 published resource controller per shard. This is bit wasteful for now. We can optimize this by starting a single controller per logical cluster. But this required stopping and starting the controller when a new published resource is created. This would be fist optimization we need todo as follow-up before removing feature flag and making it enabled by default.
const ( // AnnotationResourceKind is set on ClusterCachedResource objects to record the Kind of the cached resource. AnnotationResourceKind = "cache.kcp.io/resource-kind" // AnnotationResourceScope records the REST scope of the cached resource: "Namespaced" or "Cluster". AnnotationResourceScope = "cache.kcp.io/resource-scope" )
const ( // ByGVRAndLogicalCluster is the name for the index that indexes by an object's gvr and logical cluster. ByGVRAndLogicalCluster = "kcp-byGVRAndLogicalCluster" // ByIdentityAndGroupResource is the name for the index that indexes by an object's identity hash and group/resource. ByIdentityAndGroupResource = "kcp-byIdentityAndGroupResource" ByGroupResource = "kcp-byGroupResource" )
Variables ¶
This section is empty.
Functions ¶
func GVRAndLogicalClusterKey ¶
func GVRAndLogicalClusterKey(gvr schema.GroupVersionResource, cluster logicalcluster.Name) string
GVRAndShardAndLogicalClusterAndNamespaceKey creates an index key from the given parameters. Key will be in the form of version.resource.group|cluster.
func GenerateIdentitySecret ¶
TODO: This is copy from apiexport controller. We should move it to a shared location.
func GroupResourceKey ¶
func GroupResourceKey(gr schema.GroupResource) string
GroupResourceKey creates an index key from an identity hash and group/resource.
func IdentityAndGroupResourceKey ¶
func IdentityAndGroupResourceKey(identity string, gr schema.GroupResource) string
IdentityAndGroupResourceKey creates an index key from an identity hash and group/resource.
func IndexByGVRAndLogicalCluster ¶
IndexByShardAndLogicalClusterAndNamespace is an index function that indexes by an object's gvr and logical cluster.
func IndexByGroupResource ¶
IndexByGroupResource is an index function that indexes by an object's group/resource.
func IndexByIdentityAndGroupResource ¶
IndexByIdentityAndGroupResource is an index function that indexes by an object's identity hash and group/resource. Objects with an empty identity hash are not indexed.
Types ¶
type ClusterCachedResourceResource ¶
type ClusterCachedResourceResource = committer.Resource[*cachev1alpha1.ClusterCachedResourceSpec, *cachev1alpha1.ClusterCachedResourceStatus]
type Controller ¶
type Controller struct {
ClusterCachedResourceIndexer cache.Indexer
ClusterCachedResourceLister cachev1alpha1listers.ClusterCachedResourceClusterLister
// contains filtered or unexported fields
}
func NewController ¶
func NewController( shardName string, kcpClusterClient kcpclientset.ClusterInterface, kcpCacheClient kcpclientset.ClusterInterface, localDynamicClient kcpdynamic.ClusterInterface, globalDynamicClient kcpdynamic.ClusterInterface, kubeClusterClient kcpkubernetesclientset.ClusterInterface, namespaceInformer kcpcorev1informers.NamespaceClusterInformer, secretInformer kcpcorev1informers.SecretClusterInformer, cacheApiExtensionsClusterClient kcpapiextensionsclientset.ClusterInterface, cacheApiExtensionsClusterInformer kcpapiextensionsinformers.SharedInformerFactory, dynRESTMapper *dynamicrestmapper.DynamicRESTMapper, localDiscoveringDynamicKcpInformers *informer.DiscoveringDynamicSharedInformerFactory, globalDiscoveringDynamicKcpInformers *informer.DiscoveringDynamicSharedInformerFactory, clusterCachedResourceInformer cacheinformers.ClusterCachedResourceClusterInformer, ) (*Controller, error)
NewController returns a new controller for ClusterCachedResource objects.
Source Files
¶
- clustercachedresources_controller.go
- clustercachedresources_finalizer.go
- clustercachedresources_purge.go
- clustercachedresources_reconcile.go
- clustercachedresources_reconcile_annotations.go
- clustercachedresources_reconcile_checker.go
- clustercachedresources_reconcile_identity.go
- clustercachedresources_reconcile_replication.go
- clustercachedresources_reconcile_schema.go
- indexers.go