diff --git a/engine/compiler/compiler.go b/engine/compiler/compiler.go index ecf3955..5522bff 100644 --- a/engine/compiler/compiler.go +++ b/engine/compiler/compiler.go @@ -371,6 +371,11 @@ func (c *Compiler) Compile(ctx context.Context, args runtime.CompilerArgs) runti ID: id, Name: id, Path: k, + + // TODO(bradrydzewski) the volume map does not include + // a read only flag and needs to be modified to provide + // this option. + ReadOnly: false, }, } spec.Volumes = append(spec.Volumes, volume) diff --git a/engine/convert.go b/engine/convert.go index 61df01c..4b42404 100644 --- a/engine/convert.go +++ b/engine/convert.go @@ -220,6 +220,7 @@ func toMount(source *Volume, target *VolumeMount) mount.Mount { } if isBindMount(source) || isNamedPipe(source) { to.Source = source.HostPath.Path + to.ReadOnly = source.HostPath.ReadOnly } if isTempfs(source) { to.TmpfsOptions = &mount.TmpfsOptions{ diff --git a/engine/spec.go b/engine/spec.go index 1651a4a..414d165 100644 --- a/engine/spec.go +++ b/engine/spec.go @@ -101,10 +101,11 @@ type ( // VolumeHostPath mounts a file or directory from the // host node's filesystem into your container. VolumeHostPath struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Path string `json:"path,omitempty"` - Labels map[string]string `json:"labels,omitempty"` + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` } // VolumeDevice describes a mapping of a raw block