mirror of https://github.com/docker/compose.git
add support of deploy.reservation.memory
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
parent
f7961cc722
commit
7ba9aac5da
|
@ -578,6 +578,12 @@ func setReservations(reservations *types.Resource, resources *container.Resource
|
|||
if reservations == nil {
|
||||
return
|
||||
}
|
||||
// Cpu reservation is a swarm option and PIDs is only a limit
|
||||
// So we only need to map memory reservation and devices
|
||||
if reservations.MemoryBytes != 0 {
|
||||
resources.MemoryReservation = int64(reservations.MemoryBytes)
|
||||
}
|
||||
|
||||
for _, device := range reservations.Devices {
|
||||
resources.DeviceRequests = append(resources.DeviceRequests, container.DeviceRequest{
|
||||
Capabilities: [][]string{device.Capabilities},
|
||||
|
|
Loading…
Reference in New Issue