Skip to content

Commit

Permalink
feat: append nomad task mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
ttys3 committed Feb 18, 2022
1 parent 96e41ef commit 1bb78d8
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)]
* 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

0 comments on commit 1bb78d8

Please sign in to comment.