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 IdentityHash(secret *corev1.Secret) (string, error)
- func IndexByGVRAndLogicalCluster(obj interface{}) ([]string, error)
- type CachedResourceResource
- type Controller
Constants ¶
const ( ControllerName = "kcp-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 (
// ByGVRAndLogicalCluster is the name for the index that indexes by an object's gvr and logical cluster.
ByGVRAndLogicalCluster = "kcp-byGVRAndLogicalCluster"
)
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 IdentityHash ¶
TODO: This is copy from apiexport controller. We should move it to a shared location.
func IndexByGVRAndLogicalCluster ¶
IndexByShardAndLogicalClusterAndNamespace is an index function that indexes by an object's gvr and logical cluster.
Types ¶
type CachedResourceResource ¶
type CachedResourceResource = committer.Resource[*cachev1alpha1.CachedResourceSpec, *cachev1alpha1.CachedResourceStatus]
type Controller ¶
type Controller struct {
CachedResourceIndexer cache.Indexer
CachedResourceLister cachev1alpha1listers.CachedResourceClusterLister
CachedResourceEndpointSliceInformer cacheinformers.CachedResourceEndpointSliceClusterInformer
// contains filtered or unexported fields
}
func NewController ¶
func NewController( shardName string, kcpClusterClient kcpclientset.ClusterInterface, kcpCacheClient kcpclientset.ClusterInterface, dynamicClient kcpdynamic.ClusterInterface, kubeClusterClient kcpkubernetesclientset.ClusterInterface, namespaceInformer kcpcorev1informers.NamespaceClusterInformer, secretInformer kcpcorev1informers.SecretClusterInformer, dynRESTMapper *dynamicrestmapper.DynamicRESTMapper, discoveringDynamicKcpInformers *informer.DiscoveringDynamicSharedInformerFactory, cacheKcpInformers kcpinformers.SharedInformerFactory, cachedResourceInformer cacheinformers.CachedResourceClusterInformer, cachedResourceEndpointSliceInformer cacheinformers.CachedResourceEndpointSliceClusterInformer, ) (*Controller, error)
NewController returns a new controller for CachedResource objects.