Skip to content

Commit

Permalink
Merge pull request #169 from hashicorp/host-volume-support
Browse files Browse the repository at this point in the history
support host/CSI volumes and using podman tasks as CSI plugins
  • Loading branch information
lgfa29 authored May 30, 2022
2 parents eca49f9 + 13efdf7 commit c158df4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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)]
* runtime: Add support for host and CSI volumes and using podman tasks as CSI plugins [[GH-169](https://github.com/hashicorp/nomad-driver-podman/pull/169)]

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 @@ -1084,6 +1084,19 @@ func (d *Driver) containerMounts(task *drivers.TaskConfig, driverConfig *TaskCon
binds = append(binds, bind)
}

// create binds for host volumes, CSI plugins, and CSI volumes
for _, m := range task.Mounts {
bind := spec.Mount{
Type: "bind",
Destination: m.TaskPath,
Source: m.HostPath,
}
if m.Readonly {
bind.Options = append(bind.Options, "ro")
}
binds = append(binds, bind)
}

if selinuxLabel := d.config.Volumes.SelinuxLabel; selinuxLabel != "" {
// Apply SELinux Label to each volume
for i := range binds {
Expand Down

0 comments on commit c158df4

Please sign in to comment.