added shm_size
This commit is contained in:
@@ -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,
|
||||
|
||||
//
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user