Documentation ¶
Overview ¶
Package uniquename features utility functions that help format unique names for exporting and importing cluster-scoped and fleet-scoped resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterScopedUniqueName ¶
ClusterScopedUniqueName returns a name that is guaranteed to be unique within a cluster. The name is formatted using an object's namespace, its name, and a 5 character long UUID suffix; the format is [NAMESPACE]-[NAME]-[SUFFIX], e.g. an object `app` from the namespace `work` will be assigned a unique name like `work-app-1x2yz`. The function may truncate name components as it sees fit. Note: this function assumes that
func FleetScopedUniqueName ¶
FleetScopedUniqueName returns a name that is guaranteed to be unique within a cluster. The name is formatted using an object's origin cluster, an object's namespace, its name, and a 5 character long UUID suffix; the format is [CLUSTER ID]-[NAMESPACE]-[NAME]-[SUFFIX], e.g. an object `app` from the namespace `work` in cluster `bravelion` will be assigned a unique name like `bravelion-work-app-1x2yz`. The function may truncate name components as it sees fit. Note: this function assumes that
func RandomLowerCaseAlphabeticString ¶
RandomLowerCaseAlphabeticString returns a string of lower case alphabetic characters only. This function is best used for fallback cases where one cannot format a unique name as expected, as a lower case alphabetic string of proper length is always a valid Kubernetes object name, regardless of the required name format for the object (RFC 1123 DNS subdomain, RFC 1123 DNS label, or RFC 1035 DNS label).
Types ¶
type Format ¶
type Format int
const ( // DNS1123Subdomain dictates that the unique name should be a valid RFC 1123 DNS subdomain. DNS1123Subdomain Format = 1 // DNS1123Label dictates that the unique name should be a valid RFC 1123 DNS label. DNS1123Label Format = 2 // DNS1035Label dictates that the unique name should be a valid RFC 1035 DNS label. DNS1035Label Format = 3 )