Skip to content

Commit

Permalink
volume: Add the missing option propagation_mode (#15626)
Browse files Browse the repository at this point in the history
  • Loading branch information
shumin1027 authored Jan 30, 2023
1 parent 031765b commit 69b08bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .changelog/15626.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
fix: Add the missing option propagation_mode for volume_mount
```
14 changes: 8 additions & 6 deletions client/allocrunner/taskrunner/volume_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ func (h *volumeHook) hostVolumeMountConfigurations(taskMounts []*structs.VolumeM
}

mcfg := &drivers.MountConfig{
HostPath: hostVolume.Path,
TaskPath: m.Destination,
Readonly: hostVolume.ReadOnly || req.ReadOnly || m.ReadOnly,
HostPath: hostVolume.Path,
TaskPath: m.Destination,
Readonly: hostVolume.ReadOnly || req.ReadOnly || m.ReadOnly,
PropagationMode: m.PropagationMode,
}
mounts = append(mounts, mcfg)
}
Expand Down Expand Up @@ -180,9 +181,10 @@ func (h *volumeHook) prepareCSIVolumes(req *interfaces.TaskPrestartRequest, volu

for _, m := range mountsForAlias {
mcfg := &drivers.MountConfig{
HostPath: csiMountPoint.Source,
TaskPath: m.Destination,
Readonly: request.ReadOnly || m.ReadOnly,
HostPath: csiMountPoint.Source,
TaskPath: m.Destination,
Readonly: request.ReadOnly || m.ReadOnly,
PropagationMode: m.PropagationMode,
}
mounts = append(mounts, mcfg)
}
Expand Down
1 change: 1 addition & 0 deletions website/content/docs/job-specification/volume_mount.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ job "docs" {
volume_mount {
volume = "certs"
destination = "/etc/ssl/certs"
propagation_mode = "private"
}
}
}
Expand Down

0 comments on commit 69b08bb

Please sign in to comment.