Forráskód Böngészése

Merge pull request #1648 from ndeloof/single_ulimit

Nicolas De loof 4 éve
szülő
commit
f1aaab1943
1 módosított fájl, 10 hozzáadás és 2 törlés
  1. 10 2
      local/compose/create.go

+ 10 - 2
local/compose/create.go

@@ -438,10 +438,18 @@ func getDeployResources(s types.ServiceConfig) container.Resources {
 	}
 
 	for name, u := range s.Ulimits {
+		soft := u.Single
+		if u.Soft != 0 {
+			soft = u.Soft
+		}
+		hard := u.Single
+		if u.Hard != 0 {
+			hard = u.Hard
+		}
 		resources.Ulimits = append(resources.Ulimits, &units.Ulimit{
 			Name: name,
-			Hard: int64(u.Hard),
-			Soft: int64(u.Soft),
+			Hard: int64(soft),
+			Soft: int64(hard),
 		})
 	}
 	return resources