Skip to content

Commit

Permalink
add volume mount propagation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
shumin1027 committed Dec 26, 2022
1 parent f452441 commit c7ffd0c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions client/allocrunner/taskrunner/volume_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,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 @@ -171,9 +172,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

0 comments on commit c7ffd0c

Please sign in to comment.