moby/daemon/update_linux.go
Tonis Tiigi 9c4570a958 Replace execdrivers with containerd implementation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-03-18 13:38:32 -07:00

25 lines
745 B
Go

// +build linux
package daemon
import (
"github.com/docker/docker/libcontainerd"
"github.com/docker/engine-api/types/container"
)
func toContainerdResources(resources container.Resources) libcontainerd.Resources {
var r libcontainerd.Resources
r.BlkioWeight = uint32(resources.BlkioWeight)
r.CpuShares = uint32(resources.CPUShares)
r.CpuPeriod = uint32(resources.CPUPeriod)
r.CpuQuota = uint32(resources.CPUQuota)
r.CpusetCpus = resources.CpusetCpus
r.CpusetMems = resources.CpusetMems
r.MemoryLimit = uint32(resources.Memory)
if resources.MemorySwap > 0 {
r.MemorySwap = uint32(resources.MemorySwap)
}
r.MemoryReservation = uint32(resources.MemoryReservation)
r.KernelMemoryLimit = uint32(resources.KernelMemory)
return r
}