@@ -126,7 +126,7 @@ class KubernetesStateYamlSpec extends AnyFlatSpec with Matchers with ScalaCheckP
126
126
| resources:
127
127
| requests:
128
128
| memory: "256Mi"
129
- | cpu: "500m "
129
+ | cpu: "100m "
130
130
| limits:
131
131
| memory: "512Mi"
132
132
| cpu: "1000m"
@@ -204,7 +204,7 @@ class KubernetesStateYamlSpec extends AnyFlatSpec with Matchers with ScalaCheckP
204
204
| resources:
205
205
| requests:
206
206
| memory: "256Mi"
207
- | cpu: "500m "
207
+ | cpu: "100m "
208
208
| limits:
209
209
| memory: "512Mi"
210
210
| cpu: "1000m"
@@ -280,7 +280,7 @@ class KubernetesStateYamlSpec extends AnyFlatSpec with Matchers with ScalaCheckP
280
280
| resources:
281
281
| requests:
282
282
| memory: "256Mi"
283
- | cpu: "500m "
283
+ | cpu: "100m "
284
284
| limits:
285
285
| memory: "512Mi"
286
286
| cpu: "1000m"
@@ -295,81 +295,6 @@ class KubernetesStateYamlSpec extends AnyFlatSpec with Matchers with ScalaCheckP
295
295
}
296
296
}
297
297
298
- " kubernetes sample" must " be generated from definition" in {
299
-
300
- forAll(lowEmptyChance) { deploymentTestParts : DeploymentTestParts =>
301
- import deploymentTestParts ._
302
- whenever(nonEmptyParts(deploymentTestParts)) {
303
- val deployment = deploy
304
- .namespace(namespace)
305
- .service(serviceName)
306
- .withImage(dockerImage)
307
- .withProbes(
308
- livenessProbe = HttpProbe (HttpGet (" /health" , 8080 , List .empty), initialDelay = 3 seconds, period = 5 seconds),
309
- readinessProbe = NoProbe
310
- )
311
- .replicas(1 )
312
- .addPorts(List (Port (Some (" app" ), 8080 )))
313
- .annotateSpecTemplate(Map (metadataKey -> metadataValue))
314
- .env(envName, envValue)
315
-
316
- val expectedYaml = parse(s """
317
- |apiVersion: apps/v1
318
- |kind: Deployment
319
- |metadata:
320
- | name: &name " ${serviceName}"
321
- | namespace: " ${namespace}"
322
- |spec:
323
- | replicas: 1
324
- | selector:
325
- | matchLabels:
326
- | app: *name
327
- | strategy:
328
- | type: RollingUpdate
329
- | rollingUpdate:
330
- | maxSurge: 0
331
- | maxUnavailable: 1
332
- | template:
333
- | metadata:
334
- | labels:
335
- | app: *name
336
- | annotations:
337
- | ${metadataKey}: " ${metadataValue}"
338
- | spec:
339
- | containers:
340
- | - image: " ${dockerImage}"
341
- | imagePullPolicy: IfNotPresent
342
- | name: *name
343
- | ports:
344
- | - name: app
345
- | containerPort: 8080
346
- | livenessProbe:
347
- | httpGet:
348
- | path: /health
349
- | port: 8080
350
- | initialDelaySeconds: 3
351
- | periodSeconds : 5
352
- | successThreshold: 1
353
- | failureThreshold: 3
354
- | timeoutSeconds: 1
355
- | resources:
356
- | requests:
357
- | memory: "256Mi"
358
- | cpu: "500m"
359
- | limits:
360
- | memory: "512Mi"
361
- | cpu: "1000m"
362
- | env:
363
- | - name: " ${envName}"
364
- | value: " ${envValue}"
365
- | """ .stripMargin)
366
- val actualJson = Right (deployment.asJson)
367
-
368
- actualJson shouldBe expectedYaml
369
- }
370
- }
371
- }
372
-
373
298
" cpu and memory" must " be encoded as strings with m and MiB indicators" in {
374
299
Cpu (500 ).asJson shouldBe " 500m" .asJson
375
300
Memory (128 ).asJson shouldBe " 128Mi" .asJson
0 commit comments