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

nomad-pack treats any variables called region or namespace as Nomad region/namespace settings #422

Open
pkazmierczak opened this issue Sep 12, 2023 · 2 comments

Comments

@pkazmierczak
Copy link
Contributor

As reported in #366 (comment), the regex-based solution for figuring out region/namespace before submitting the template to Nomad client is faulty and will treat any region and namespace variable as if it were setting region or namespace for the job. We need to find a better way to extract region and namespace information from the template and not rely on regular expressions for this.

@pkazmierczak pkazmierczak changed the title Nomad-pack mistakenly treats any variables called region or namespace as Nomad region/namespace settings nomad-pack treats any variables called region or namespace as Nomad region/namespace settings Sep 12, 2023
@mikenomitch
Copy link
Contributor

Hey @slonopotamus, just FYI that we made this its own issue.

We'd like to fix this, but we just synced internally and we'll probably have to get the 0.1 release of Pack out before fixing this. It's a pretty gross issue, so sorry about the delay, but we'll have to circle back to core-Nomad for a bit after the 0.1 release, so it may sit for a bit.

@slonopotamus
Copy link
Contributor

slonopotamus commented Sep 12, 2023

I've workarounded this (by renaming my variable, huh). But I believe that the whole approach simply doesn't work. Regexes will pick up unrelated stuff. Also, as I understand, regex is ran against raw nomad-pack file. But region/namespace could be specified via variables (almost all packs in nomad-pack-community-registry do this), so again, we end up with garbage instead of region.

And please do not forget that pack can consist of multiple jobs some of which belong to different regions when redesigning a fix for this issue!

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

No branches or pull requests

3 participants