add some basic stubs for ro volume support

This commit is contained in:
Brad Rydzewski
2020-01-15 11:44:23 -08:00
parent 6ba65c68ac
commit 0bd2dff3dd
3 changed files with 11 additions and 4 deletions

View File

@@ -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)

View File

@@ -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{

View File

@@ -105,6 +105,7 @@ type (
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