From 1c4375163a50ff755bed57194737e13b857fcba8 Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Fri, 17 Nov 2017 08:44:18 -0600 Subject: [PATCH] Change error message to use original name for clarity, rather than the name after substituting env vars with placeholder. --- nomad/structs/structs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 8de720d52..c07ccf9ba 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -3079,7 +3079,7 @@ func (s *Service) Validate() error { serviceNameStripped := args.ReplaceEnvWithPlaceHolder(s.Name, "ENV-VAR") if err := s.ValidateName(serviceNameStripped); err != nil { - mErr.Errors = append(mErr.Errors, err) + mErr.Errors = append(mErr.Errors, fmt.Errorf("service name must be valid per RFC 1123 and can contain only alphanumeric characters or dashes: %q", s.Name)) } switch s.AddressMode {