Parsing 'Region' and 'Namespace' fails when containing non-word characters
johanforssell opened this issue · 1 comments
johanforssell commented
nomad-pack/internal/runner/job/job.go
Lines 250 to 251 in 09ad317
\w+
is used to parse the region
and the namespace
. This is inadequate when they contain non-word characters.
"-
" is a common non-word character which even shows up in the official documentation of Namespaces.
$ export NOMAD_NAMESPACE=web-qa
I've been looking in the Nomad code but cannot find any validation rules for the name of a namespace.
On another note, the error message for failing to run/plan a job could use some improvements. I had to pull down the source code and do my own debugging to understand that my namespace was truncated on submit.
slonopotamus commented
This regex thing is very broken by design, see #422 (comment)