This project is mirrored from https://gitee.com/mirrors/nomad.git.
Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
- 18 Apr, 2022 1 commit
-
-
Seth Hoenig authored
This PR substitutes consul/sdk for nomad/sdk. Major difference in the implementation of freeport, where the new version is based on ephemoral ports instead of pre-allocated port blocks.
-
- 06 Apr, 2022 1 commit
-
-
James Rasell authored
This change modifies the template task runner to utilise the new consul-template which includes Nomad service lookup template funcs. In order to provide security and auth to consul-template, we use a custom HTTP dialer which is passed to consul-template when setting up the runner. This method follows Vault implementation. Co-authored-by:
Michael Schurter <mschurter@hashicorp.com>
-
- 29 Mar, 2022 2 commits
-
-
Michael Schurter authored
Review notes from @lgfa29 Co-authored-by:
Luiz Aoqui <luiz@hashicorp.com>
-
Michael Schurter authored
Resolves #12095 by WONTFIXing it. This approach disables `writeToFile` as it allows arbitrary host filesystem writes and is only a small quality of life improvement over multiple `template` stanzas. This approach has the significant downside of leaving people who have altered their `template.function_denylist` *still vulnerable!* I added an upgrade note, but we should have implemented the denylist as a `map[string]bool` so that new funcs could be denied without overriding custom configurations. This PR also includes a bug fix that broke enabling all consul-template funcs. We repeatedly failed to differentiate between a nil (unset) denylist and an empty (allow all) one.
-
- 15 Mar, 2022 1 commit
-
-
Seth Hoenig authored
-
- 10 Jan, 2022 1 commit
-
-
Derek Strickland authored
This PR exposes the following existing`consul-template` configuration options to Nomad jobspec authors in the `{job.group.task.template}` stanza. - `wait` It also exposes the following`consul-template` configuration to Nomad operators in the `{client.template}` stanza. - `max_stale` - `block_query_wait` - `consul_retry` - `vault_retry` - `wait` Finally, it adds the following new Nomad-specific configuration to the `{client.template}` stanza that allows Operators to set bounds on what `jobspec` authors configure. - `wait_bounds` Co-authored-by:
Tim Gross <tgross@hashicorp.com> Co-authored-by:
Michael Schurter <mschurter@hashicorp.com>
-
- 18 Oct, 2021 1 commit
-
-
Michael Schurter authored
Fixes #2522 Skip embedding client.alloc_dir when building chroot. If a user configures a Nomad client agent so that the chroot_env will embed the client.alloc_dir, Nomad will happily infinitely recurse while building the chroot until something horrible happens. The best case scenario is the filesystem's path length limit is hit. The worst case scenario is disk space is exhausted. A bad agent configuration will look something like this: ```hcl data_dir = "/tmp/nomad-badagent" client { enabled = true chroot_env { # Note that the source matches the data_dir "/tmp/nomad-badagent" = "/ohno" # ... } } ``` Note that `/ohno/client` (the state_dir) will still be created but not `/ohno/alloc` (the alloc_dir). While I cannot think of a good reason why someone would want to embed Nomad's client (and possibly server) directories in chroots, there should be no cause for harm. chroots are only built when Nomad runs as root, and Nomad disables running exec j...
-
- 04 Jan, 2021 2 commits
-
-
Chris Baker authored
-
Chris Baker authored
resolves #9839 resolves #6929 resolves #6910 e2e: template env interpolation path testing
-
- 16 Dec, 2020 1 commit
-
-
Tim Gross authored
When a task is restored after a client restart, the template runner will create a new lease for any dynamic secret (ex. Consul or PKI secrets engines). But because this lease is being created in the prestart hook, we don't trigger the `change_mode`. This changeset uses the the existence of the task handle to detect a previously running task that's been restored, so that we can trigger the template `change_mode` if the template is changed, as it will be only with dynamic secrets.
-
- 18 Nov, 2020 2 commits
-
-
Michael Schurter authored
-
Michael Schurter authored
While Nomad v0.12.8 fixed `NOMAD_{ALLOC,TASK,SECRETS}_DIR` use in `template.destination`, interpolating these variables in `template.source` caused a path escape error. **Why not apply the destination fix to source?** The destination fix forces destination to always be relative to the task directory. This makes sense for the destination as a destination outside the task directory would be unreachable by the task. There's no reason to ever render a template outside the task directory. (Using `..` does allow destinations to escape the task directory if `template.disable_file_sandbox = true`. That's just awkward and unsafe enough I hope no one uses it.) There is a reason to source a template outside a task directory. At least if there weren't then I can't think of why we implemented `template.disable_file_sandbox`. So v0.12.8 left the behavior of `template.source` the more straightforward "Interpolate and validate." However, since outside of `raw_exec` every other driver uses absolute paths for `NOMAD_*_DIR` interpolation, this means those variables are unusable unless `disable_file_sandbox` is set. **The Fix** The variables are now interpolated as relative paths *only for the purpose of rendering templates.* This is an unfortunate special case, but reflects the fact that the templates view of the filesystem is completely different (unconstrainted) vs the task's view (chrooted). Arguably the values of these variables *should be context-specific.* I think it's more reasonable to think of the "hack" as templating running uncontainerized than that giving templates different paths is a hack. **TODO** - [ ] E2E tests - [ ] Job validation may still be broken and prevent my fix from working? **raw_exec** `raw_exec` is actually broken _a different way_ as exercised by tests in this commit. I think we should probably remove these tests and fix that in a followup PR/release, but I wanted to leave them in for the initial review and discussion. Since non-containerized source paths are broken anyway, perhaps there's another solution to this entire problem I'm overlooking?
-
- 21 Oct, 2020 1 commit
-
-
Tim Gross authored
Ensure that the client honors the client configuration for the `template.disable_file_sandbox` field when validating the jobspec's `template.source` parameter, and not just with consul-template's own `file` function. Prevent interpolated `template.source`, `template.destination`, and `artifact.destination` fields from escaping file sandbox.
-
- 01 Oct, 2020 1 commit
-
-
Fredrik Hoem Grelland authored
-
- 24 Aug, 2020 2 commits
-
-
Seth Hoenig authored
-
Yoan Blanc authored
Signed-off-by:
Yoan Blanc <yoan@dosimple.ch>
-
- 24 Jul, 2020 1 commit
-
-
Drew Bailey authored
adds in oss components to support enterprise multi-vault namespace feature upgrade specific doc on vault multi-namespaces vault docs update test to reflect new error
-
- 09 May, 2020 1 commit
-
-
Mahmood Ali authored
This change deflakes TestTaskTemplateManager_BlockedEvents test, because it is expecting a number of events without accounting for transitional state. The test TestTaskTemplateManager_BlockedEvents attempts to ensure that a template rendering emits blocked events for missing template ksys. It works by setting a template that requires keys 0,1,2,3,4 and then eventually sets keys 0,1,2,3 and ensures that we get a final event indicating that keys 3 and 4 are still missing. The test waits to get a blocked event for the final state, but it can fail if receives a blocked event for a transitional state (e.g. one reporting 2,3,4,5 are missing). This fixes the test by ensuring that it waits until the final message before assertion. Also, it clarifies the intent of the test with stricter assertions and additional comments.
-
- 23 Feb, 2020 1 commit
-
-
Fredrik Hoem Grelland authored
-
- 16 Feb, 2020 1 commit
-
-
Mahmood Ali authored
-
- 12 Aug, 2019 1 commit
-
-
Tim Gross authored
When rendering a task template, the `plugin` function is no longer permitted by default and will raise an error. An operator can opt-in to permitting this function with the new `template.function_blacklist` field in the client configuration. When rendering a task template, path parameters for the `file` function will be treated as relative to the task directory by default. Relative paths or symlinks that point outside the task directory will raise an error. An operator can opt-out of this protection with the new `template.disable_file_sandbox` field in the client configuration.
-
- 05 Aug, 2019 1 commit
-
-
Mahmood Ali authored
When rendering a task consul template, ensure that only task environment variables are used. Currently, `consul-template` always falls back to host process environment variables when key isn't a task env var[1]. Thus, we add an empty entry for each host process env-var not found in task env-vars. [1] https://github.com/hashicorp/consul-template/blob/bfa5d0e133688920afd1e012404f765182e3d5e0/template/funcs.go#L61-L75
-
- 21 May, 2019 1 commit
-
-
Mahmood Ali authored
tests: fix data race in client/allocrunner/taskrunner/template TestTaskTemplateManager_Rerender_Signal Given that Signal may be called multiple times, blocking for `SignalCh` isn't sufficient to synchornizing access to Signals field.
-
- 10 Apr, 2019 4 commits
-
-
Chris Baker authored
-
Chris Baker authored
-
Chris Baker authored
-
Chris Baker authored
-
- 28 Jan, 2019 1 commit
-
-
Alex Dadgar authored
Fixes an issue where env templates that had interpolated destinations would not work. Fixes https://github.com/hashicorp/nomad/issues/5250
-
- 30 Nov, 2018 2 commits
-
-
Danielle Tomlinson authored
-
Danielle Tomlinson authored
As part of deprecating legacy drivers, we're moving the env package to a new drivers/shared tree, as it is used by the modern docker and rkt driver packages, and is useful for 3rd party plugins.
-
- 16 Oct, 2018 4 commits
-
-
Michael Schurter authored
-
Alex Dadgar authored
-
Alex Dadgar authored
-
Alex Dadgar authored
-
- 12 Jun, 2018 2 commits
-
-
Alex Dadgar authored
-
Alex Dadgar authored
-
- 11 Mar, 2018 1 commit
-
-
Josh Soref authored
-
- 10 Nov, 2017 1 commit
-
-
Alex Dadgar authored
Fixes https://github.com/hashicorp/nomad/issues/3498
-
- 14 Sep, 2017 1 commit
-
-
Michael Schurter authored
Also expose a mock Consul Agent to allow testing ServiceClient and checkWatcher from TaskRunner without actually talking to a real Consul.
-
- 10 Aug, 2017 1 commit
-
-
Alex Dadgar authored
This PR does the following: * Adds a mechanism to emit events in the TaskRunner * Vendors a new version of Consul-Template that allows extraction of missing dependencies * Adds logic to our consul_template.go to determine missing events and emit them in a batched fashion. * Refactors the consul_template code to split the run method and take in a config struct rather than many parameters. Fixes https://github.com/hashicorp/nomad/issues/2578
-