mirror of
https://github.com/docker/compose.git
synced 2025-07-02 19:34:25 +02:00
Merge pull request #9947 from glours/manage-resources-reservations
add support of deploy.reservation.memory
This commit is contained in:
commit
df9e605b31
@ -592,6 +592,12 @@ func setReservations(reservations *types.Resource, resources *container.Resource
|
|||||||
if reservations == nil {
|
if reservations == nil {
|
||||||
return
|
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 {
|
for _, device := range reservations.Devices {
|
||||||
resources.DeviceRequests = append(resources.DeviceRequests, container.DeviceRequest{
|
resources.DeviceRequests = append(resources.DeviceRequests, container.DeviceRequest{
|
||||||
Capabilities: [][]string{device.Capabilities},
|
Capabilities: [][]string{device.Capabilities},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user