mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
style: update documentation (#16729)
This commit is contained in:
committed by
GitHub
parent
e6da5c70dc
commit
5e9b9ef0d3
@@ -799,6 +799,9 @@ func (s *Service) ValidateName(name string) error {
|
||||
// (https://tools.ietf.org/html/rfc952), RFC-1123 §2.1
|
||||
// (https://tools.ietf.org/html/rfc1123), and RFC-2782
|
||||
// (https://tools.ietf.org/html/rfc2782).
|
||||
// This validation is enforced on Nomad, but not on Consul, however if
|
||||
// consul-template is being used, service names with dots in them wont be
|
||||
// admissible.
|
||||
re := regexp.MustCompile(`^(?i:[a-z0-9]|[a-z0-9][a-z0-9\-]{0,61}[a-z0-9])$`)
|
||||
if !re.MatchString(name) {
|
||||
return fmt.Errorf("Service name must be valid per RFC 1123 and can contain only alphanumeric characters or dashes and must be no longer than 63 characters")
|
||||
|
||||
Reference in New Issue
Block a user