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

feat: append nomad task mounts #152

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FEATURES:
* config: Privileged containers.
* config: Add `cpu_hard_limit` and `cpu_cfs_period` options [[GH-149](https://github.com/hashicorp/nomad-driver-podman/pull/149)]
* config: Allow mounting rootfs as read-only. [[GH-133](https://github.com/hashicorp/nomad-driver-podman/pull/133)]
* volume: Add host volumes support for `volume_mount` Stanza [[GH-152](https://github.com/hashicorp/nomad-driver-podman/pull/152)]

BUG FIXES:
* log: Use error key context to log errors rather than Go err style. [[GH-126](https://github.com/hashicorp/nomad-driver-podman/pull/126)]
Expand Down
13 changes: 13 additions & 0 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,19 @@ func (d *Driver) containerMounts(task *drivers.TaskConfig, driverConfig *TaskCon
binds = append(binds, bind)
}

// append nomad task mounts
for _, mnt := range task.Mounts {
bind := spec.Mount{
Source: mnt.HostPath,
Destination: mnt.TaskPath,
Type: "bind",
}
if mnt.Readonly {
bind.Options = []string{"ro"}
}
binds = append(binds, bind)
}

return binds, nil
}

Expand Down