-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add config field to specify chroot mapping for exec driver #1518
Conversation
parasyte
commented
Aug 4, 2016
•
edited
Loading
edited
- Same format as used by the internal chroot mapping
- Map: source_path -> dest_path
- Example HCL:
- Same format as used by the internal chroot mapping - Map: source_path -> dest_path - Example HCL: client { chroot_env { "/etc" = "/etc" "/lib" = "/lib" "/opt/projects/foo/bin" = "/usr/bin" } }
This can address #1507 by specifying a smaller subset of files and directories for your chroot. |
@@ -227,7 +227,12 @@ func (e *UniversalExecutor) configureChroot() error { | |||
return err | |||
} | |||
|
|||
if err := allocDir.Embed(e.ctx.Task.Name, chrootEnv); err != nil { | |||
chroot := chrootEnv | |||
if e.command.ChrootEnv != nil && len(e.command.ChrootEnv) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(e.command.ChrootEnv) > 0
since len
of nil
maps are 0
- Simplify map length check in Linux Executor - Added a `chroot_env` test for config parser - Moved `ChrootEnv` field from ExecutorCommand to ExecutorContext - Added a test for `chroot_env` functionality
@diptanu Addressed all review comments. I haven't been able to validate the new tests, because the test suite is failing on the point in master where I forked. |
Can you also add documentation to the website /docs/agent/config.html |
@dadgar 👍 Incoming. |
Thanks for the docs they look great. Though the test is failing: https://travis-ci.org/hashicorp/nomad/builds/150180275#L3656 |
Yep, it's a bad test. I know |
@parasyte |
@jshaw86 I am hoping this would get into the 0.4.1 release if everything goes well. |
- Properly expects the hard-coded mounts (alloc, dev, and proc) and hardcoded local directories (local and tmp) - Also verifies that etc contains only the requested paths
This test is also failing: https://travis-ci.org/hashicorp/nomad/builds/150759498#L5510 |
Ok, got that one too! |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |