added shm_size

This commit is contained in:
Brad Rydzewski
2019-10-26 11:33:52 -07:00
parent a319f263c9
commit 3c1ae23a1e
4 changed files with 6 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ func createStep(spec *resource.Pipeline, src *resource.Step) *engine.Step {
Pull: convertPullPolicy(src.Pull),
User: src.User,
Secrets: convertSecretEnv(src.Environment),
ShmSize: int64(src.ShmSize),
WorkingDir: src.WorkingDir,
//

View File

@@ -54,7 +54,7 @@ func toHostConfig(spec *Spec, step *Step) *container.HostConfig {
Type: "json-file",
},
Privileged: step.Privileged,
// TODO(bradrydzewski) set ShmSize
ShmSize: step.ShmSize,
}
// windows does not support privileged so we hard-code
// this value to false.

View File

@@ -115,6 +115,9 @@ func checkStep(step *resource.Step, trusted bool) error {
if trusted == false && len(step.Network) > 0 {
return errors.New("linter: untrusted repositories cannot configure network_mode")
}
if trusted == false && int(step.ShmSize) > 0 {
return errors.New("linter: untrusted repositories cannot configure shm_size")
}
for _, mount := range step.Volumes {
switch mount.Name {
case "workspace", "_workspace", "_docker_socket":

View File

@@ -103,6 +103,7 @@ type (
Pull string `json:"pull,omitempty"`
Settings map[string]*manifest.Parameter `json:"settings,omitempty"`
Shell string `json:"shell,omitempty"`
ShmSize manifest.BytesSize `json:"shm_size,omitempty"`
User string `json:"user,omitempty"`
Volumes []*VolumeMount `json:"volumes,omitempty"`
When manifest.Conditions `json:"when,omitempty"`