agent: clarify the valid characters for dns

This commit is contained in:
Ryan Uber 2015-02-09 09:59:21 -08:00
parent c6ec9dd844
commit 103e9e7fc1
1 changed files with 4 additions and 2 deletions

View File

@ -604,14 +604,16 @@ func (a *Agent) AddService(service *structs.NodeService, chkTypes CheckTypes, pe
// Warn if the service name is incompatible with DNS // Warn if the service name is incompatible with DNS
if !dnsNameRe.MatchString(service.Service) { if !dnsNameRe.MatchString(service.Service) {
a.logger.Printf("[WARN] Service name %q will not be discoverable "+ a.logger.Printf("[WARN] Service name %q will not be discoverable "+
"via DNS due to invalid characters", service.Service) "via DNS due to invalid characters. Valid characters include "+
"all alpha-numerics and dashes.", service.Service)
} }
// Warn if any tags are incompatible with DNS // Warn if any tags are incompatible with DNS
for _, tag := range service.Tags { for _, tag := range service.Tags {
if !dnsNameRe.MatchString(tag) { if !dnsNameRe.MatchString(tag) {
a.logger.Printf("[WARN] Service tag %q will not be discoverable "+ a.logger.Printf("[WARN] Service tag %q will not be discoverable "+
"via DNS due to invalid characters", tag) "via DNS due to invalid characters. Valid characters include "+
"all alpha-numerics and dashes.", tag)
} }
} }