Documentation
¶
Index ¶
Constants ¶
const DumpMaxBytes int64 = 2 * 1024 * 1024
DumpMaxBytes is the default cap on the total size of entry values returned in a single LogicalClusterDump page, used when the request doesn't specify spec.maxBytes.
const ScanPageSize int64 = 1000
ScanPageSize is the page size used in etcd range scans.
Variables ¶
This section is empty.
Functions ¶
func BelongsToCluster ¶ added in v0.31.5
func BelongsToCluster(prefix, key string, lc logicalcluster.Name) bool
BelongsToCluster reports whether key belongs to logical cluster lc. It checks both the built-in (parts[2]) and CRD/identity-based (parts[3]) cluster positions via SplitKey.
func ClusterOf ¶ added in v0.33.0
ClusterOf returns the logical cluster a storage key belongs to. Unlike SplitKey it does not require a target logical cluster: the ambiguous 5-segment case (group/resource/cluster/namespace/name for built-in namespaced resources vs. group/resource/identity/cluster/name for identity-based cluster-scoped resources) is resolved via isCluster, which reports whether the given segment is a known logical cluster name.
Types ¶
type KeyParts ¶ added in v0.31.5
type KeyParts struct {
Group string
Resource string
// Segment is "customresources", an identity hash, or "" for built-in resources.
Segment string
Cluster logicalcluster.Name
// Rest is everything after the cluster segment: [<namespace>/]<name>.
Rest string
}
KeyParts holds the parsed components of an etcd key produced by SplitKey.
func SplitKey ¶ added in v0.31.5
func SplitKey(prefix, key string, lc logicalcluster.Name) (KeyParts, bool)
SplitKey parses an etcd key into its structural components. true is only returned when the key was parsed correctly into KeyParts, not if KeyParts matches the lc.
func (KeyParts) ClusterPrefix ¶ added in v0.31.5
ClusterPrefix reconstructs the etcd key prefix that scopes.