Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing 'Region' and 'Namespace' fails when containing non-word characters #522

Open
johanforssell opened this issue Jun 14, 2024 · 1 comment
Labels

Comments

@johanforssell
Copy link

johanforssell commented Jun 14, 2024

namespaceRe := regexp.MustCompile(`(?m)namespace = \"(\w+)`)
regionRe := regexp.MustCompile(`(?m)region = \"(\w+)`)

\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.

@johanforssell johanforssell changed the title Parsing of Region and Namespace fails when containing non-word characters. Parsing 'Region' and 'Namespace' fails when containing non-word characters Jun 14, 2024
@angrycub angrycub added type/bug stage/good-first-issue theme/runner/job Relates to the internal job runner labels Jun 14, 2024
@slonopotamus
Copy link
Contributor

This regex thing is very broken by design, see #422 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants