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

raw_exec and other unisolated drivers have buggy interpolation in templates #9389

Closed
schmichael opened this issue Nov 18, 2020 · 1 comment · Fixed by #9671
Closed

raw_exec and other unisolated drivers have buggy interpolation in templates #9389

schmichael opened this issue Nov 18, 2020 · 1 comment · Fixed by #9671

Comments

@schmichael
Copy link
Member

Nomad version

Nomad v0.12.8 (b850164)

Issue

Interpolation for NOMAD_ALLOC_DIR, NOMAD_TASK_DIR, and NOMAD_SECRETS_DIR is broken for template stanzas when using task drivers like raw_exec which do not have any filesystem isolation.

The way the NOMAD_*_DIR environment variables are initialized depends on whether or not the task driver supports filesystem isolation:

https://github.com/hashicorp/nomad/blob/v0.12.8/client/allocrunner/taskrunner/task_dir_hook.go#L77-L98

However, when interpolating these variables for templating we improperly handle them and cause them to be broken/unusable.

See https://github.com/hashicorp/nomad/pull/9383/files#r526105415 and the associated PR description.

Reproduction steps

In an agent with raw_exec enabled (or the dev agent):

nomad run https://gist.githubusercontent.com/schmichael/2a9132537956c6c764461bb59671c45c/raw/cdf8d11b10c5db4d34e2bee3dff228aaf26719d7/rawexecrepro.hcl

Job file (if appropriate)

https://gist.github.com/schmichael/2a9132537956c6c764461bb59671c45c

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant