From 6afadeb360826d3074f33de9bd344f84df004263 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 19 May 2022 14:52:58 -0400 Subject: [PATCH 1/2] support host/CSI volumes and using podman tasks as CSI plugins --- driver.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/driver.go b/driver.go index 2db8b35b..49322985 100644 --- a/driver.go +++ b/driver.go @@ -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 { From 13efdf7764fde9568fbc808486d32aeaaf970a9b Mon Sep 17 00:00:00 2001 From: Luiz Aoqui Date: Mon, 30 May 2022 15:31:53 -0400 Subject: [PATCH 2/2] changelog: add entry for #169 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94f8da50..8e074abb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)]