Skip to content

Commit 321bfa8

Browse files
makoscafeerbren
andauthored
Added more mutations and refactor test to test each mutation separately (#734)
* added more mutations and refactor test to test each mutation separately * added more mutation definitions * update spec for controller * added mutations for cpu and memory request and limits * update request memory mutation * added liveness and probes * rmeove hostport mutation * added multiple mutations for request and limits memory Co-authored-by: Robert Brennan <[email protected]>
1 parent 78838a6 commit 321bfa8

22 files changed

+104
-20
lines changed

checks/cpuLimitsMissing.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ schema:
2525
type: string
2626
not:
2727
const: ''
28+
mutations:
29+
- op: add
30+
path: /resources/limits/cpu
31+
value: 100m

checks/cpuRequestsMissing.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ schema:
2525
type: string
2626
not:
2727
const: ''
28+
mutations:
29+
- op: add
30+
path: /resources/requests/cpu
31+
value: 100m

checks/deploymentMissingReplicas.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ schema:
1919
replicas:
2020
type: integer
2121
minimum: 2
22+
mutations:
23+
- op: add
24+
path: /spec/replicas
25+
value: 3

checks/hostIPCSet.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ schema:
99
hostIPC:
1010
not:
1111
const: true
12+
mutations:
13+
- op: remove
14+
path: /hostIPC

checks/hostNetworkSet.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ schema:
99
hostNetwork:
1010
not:
1111
const: true
12+
mutations:
13+
- op: remove
14+
path: /hostNetwork

checks/hostPIDSet.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ schema:
99
hostPID:
1010
not:
1111
const: true
12+
mutations:
13+
- op: remove
14+
path: /hostPID

checks/hostPortSet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ schema:
1212
items:
1313
properties:
1414
hostPort:
15-
const: 0
15+
const: 0

checks/livenessProbeMissing.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ schema:
1919
type: object
2020
not:
2121
const: null
22+
mutations:
23+
- op: add
24+
path: /livenessProbe
25+
value: {"exec": { "command": [ "cat", "/tmp/healthy" ] }, "initialDelaySeconds": 5, "periodSeconds": 5 }

checks/memoryLimitsMissing.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ schema:
2525
type: string
2626
not:
2727
const: ''
28+
mutations:
29+
- op: add
30+
path: /resources/limits
31+
value: {}
32+
- op: add
33+
path: /resources/limits/memory
34+
value: "512Mi"

checks/memoryRequestsMissing.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ schema:
2525
type: string
2626
not:
2727
const: ''
28+
mutations:
29+
- op: add
30+
path: /resources/requests
31+
value: {}
32+
- op: add
33+
path: /resources/requests/memory
34+
value: "512Mi"

0 commit comments

Comments
 (0)