@@ -88,21 +88,21 @@ class WhiskPodBuilderTests extends FlatSpec with Matchers with KubeClientSupport
88
88
withClue(Serialization .asYaml(pod)) {
89
89
val c = getActionContainer(pod)
90
90
// min cpu is: config.millicpus
91
- c.getResources.getLimits.asScala.get(" cpu" ).map(_.getAmount) shouldBe Some (" 300m " )
91
+ c.getResources.getLimits.asScala.get(" cpu" ).map(_.getAmount) shouldBe Some (" 300 " )
92
92
}
93
93
94
94
val (pod2, _) = builder.buildPodSpec(name, testImage, 15 .MB , Map (" foo" -> " bar" ), Map (" fooL" -> " barV" ), config)
95
95
withClue(Serialization .asYaml(pod2)) {
96
96
val c = getActionContainer(pod2)
97
97
// max cpu is: config.maxMillicpus
98
- c.getResources.getLimits.asScala.get(" cpu" ).map(_.getAmount) shouldBe Some (" 1000m " )
98
+ c.getResources.getLimits.asScala.get(" cpu" ).map(_.getAmount) shouldBe Some (" 1000 " )
99
99
}
100
100
101
101
val (pod3, _) = builder.buildPodSpec(name, testImage, 7 .MB , Map (" foo" -> " bar" ), Map (" fooL" -> " barV" ), config)
102
102
withClue(Serialization .asYaml(pod3)) {
103
103
val c = getActionContainer(pod3)
104
104
// scaled cpu is: action mem/config.mem x config.maxMillicpus
105
- c.getResources.getLimits.asScala.get(" cpu" ).map(_.getAmount) shouldBe Some (" 600m " )
105
+ c.getResources.getLimits.asScala.get(" cpu" ).map(_.getAmount) shouldBe Some (" 600 " )
106
106
}
107
107
108
108
val config2 = KubernetesClientConfig (
@@ -139,8 +139,8 @@ class WhiskPodBuilderTests extends FlatSpec with Matchers with KubeClientSupport
139
139
val (pod, _) = builder.buildPodSpec(name, testImage, 2 .MB , Map (" foo" -> " bar" ), Map (" fooL" -> " barV" ), config)
140
140
withClue(Serialization .asYaml(pod)) {
141
141
val c = getActionContainer(pod)
142
- c.getResources.getLimits.asScala.get(" ephemeral-storage" ).map(_.getAmount) shouldBe Some (" 1024Mi " )
143
- c.getResources.getRequests.asScala.get(" ephemeral-storage" ).map(_.getAmount) shouldBe Some (" 1024Mi " )
142
+ c.getResources.getLimits.asScala.get(" ephemeral-storage" ).map(_.getAmount) shouldBe Some (" 1024 " )
143
+ c.getResources.getRequests.asScala.get(" ephemeral-storage" ).map(_.getAmount) shouldBe Some (" 1024 " )
144
144
}
145
145
}
146
146
@@ -222,8 +222,8 @@ class WhiskPodBuilderTests extends FlatSpec with Matchers with KubeClientSupport
222
222
new EnvVar (" foo" , " bar" , null ),
223
223
new EnvVar (" POD_UID" , null , new EnvVarSource (null , new ObjectFieldSelector (null , " metadata.uid" ), null , null ))))
224
224
225
- c.getResources.getLimits.asScala.get(" memory" ).map(_.getAmount) shouldBe Some (" 10Mi " )
226
- c.getResources.getLimits.asScala.get(" cpu" ).map(_.getAmount) shouldBe Some (" 900m " )
225
+ c.getResources.getLimits.asScala.get(" memory" ).map(_.getAmount) shouldBe Some (" 10 " )
226
+ c.getResources.getLimits.asScala.get(" cpu" ).map(_.getAmount) shouldBe Some (" 900 " )
227
227
c.getSecurityContext.getCapabilities.getDrop.asScala should contain allOf (" NET_RAW" , " NET_ADMIN" )
228
228
c.getPorts.asScala.find(_.getName == " action" ).map(_.getContainerPort) shouldBe Some (8080 )
229
229
c.getImage shouldBe testImage
0 commit comments