Skip to main content

validate_cluster_name

Function validate_cluster_name 

Source
pub fn validate_cluster_name(value: &str) -> ValidationResult
Expand description

Validate a Repository/ClusterRepository identityDefaults.cluster: an RFC 1123 label (^[a-z0-9]([a-z0-9-]*[a-z0-9])?$), 1..=CLUSTER_NAME_MAX_LEN characters, with dots called out explicitly as forbidden even though a well-formed RFC 1123 label never contains one anyway — the message needs to explain why to whoever hits it: cluster is concatenated onto a namespace as <namespace>.<cluster> for the default hostname (see crate::identity::resolve_identity), and crate::identity::classify_hostname splits that hostname back apart at the FIRST ., so a dot anywhere in cluster would make that split ambiguous.