support for mem_limit and memswap_limit

This commit is contained in:
Brad Rydzewski
2020-01-17 11:17:14 -08:00
parent 385ce04eec
commit 01bf779338
4 changed files with 38 additions and 24 deletions

View File

@@ -48,6 +48,14 @@ func createStep(spec *resource.Pipeline, src *resource.Step) *engine.Step {
// Resources: toResources(src), // TODO
}
// set container limits
if v := int64(src.MemLimit); v > 0 {
dst.MemLimit = v
}
if v := int64(src.MemSwapLimit); v > 0 {
dst.MemSwapLimit = v
}
// appends the volumes to the container def.
for _, vol := range src.Volumes {
dst.Volumes = append(dst.Volumes, &engine.VolumeMount{