Merge pull request #904 from docker/reservation

Use reservations if user has not set limits
This commit is contained in:
Nicolas De loof 2020-11-12 12:01:00 +01:00 committed by GitHub
commit 919db3f619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -389,6 +389,9 @@ func getConfiguredLimits(service types.ServiceConfig) (types.UnitBytes, int64, e
}
limits := service.Deploy.Resources.Limits
if limits == nil {
limits = service.Deploy.Resources.Reservations
}
if limits == nil {
return 0, 0, nil
}