Documentation
¶
Overview ¶
Package provider populates the tenancy directory from the tenant workspaces bound to the tenancy APIExport. It is the read side of the operator: the same discovery (multicluster-runtime over the apiexport endpoint slice), but instead of materializing workspaces it only mirrors Tenant, Project and Membership objects into the in-memory directory the virtual workspace answers from.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Clusters ¶
type Clusters struct {
// contains filtered or unexported fields
}
Clusters hands out a client for one logical cluster in the fleet.
An APIExport's virtual workspace runs per shard: the endpoint slice lists one URL for each shard serving the export, and each of those URLs serves only the clusters that live on that shard. So there is no single URL a write can be addressed to. Asking a shard about a cluster it does not host is refused as a plain Forbidden — that shard has no APIBinding for the cluster, and the virtual workspace's authorizer anonymizes the reason, so the answer is indistinguishable from the caller having no standing at all.
The read side already solves this: the provider watches every URL the slice publishes and knows which endpoint each cluster was discovered through. Clusters exposes that, so a write goes to the shard that actually holds the workspace rather than to whichever URL happened to be listed first.
type Options ¶
type Options struct {
// RestConfig reaches the kcp shard hosting the tenancy APIExports.
RestConfig *rest.Config
// PlatformSlice serves Tenants, TenancySlice serves Projects and
// Memberships. They are different exports because they live in
// different tiers, so the directory is fed by two managers.
PlatformSlice string
TenancySlice string
// Clusters, when non-nil, is filled with a handle on the two managers,
// so the caller can address a write to the shard that hosts a given
// workspace. See the type for why that is not a free choice.
Clusters *Clusters
}
Options configures the directory provider.