Skip to content

Commit fc9573c

Browse files
IlyesbdlalaWeltraumschaf
authored andcommitted
#1814 Added helm unit tests for update-field-hook hook
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
1 parent 6ac66d3 commit fc9573c

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
matches the snapshot:
2+
1: |
3+
raw: |2
4+
UpdateField Hook deployed.
5+
This will add or override "category: my-own-category" on every finding in this namespace.
6+
2: |
7+
apiVersion: execution.securecodebox.io/v1
8+
kind: ScanCompletionHook
9+
metadata:
10+
labels:
11+
app.kubernetes.io/instance: RELEASE-NAME
12+
app.kubernetes.io/managed-by: Helm
13+
app.kubernetes.io/name: update-field-hook
14+
app.kubernetes.io/version: 0.0.0
15+
foo: bar
16+
helm.sh/chart: update-field-hook-0.0.0
17+
name: RELEASE-NAME-update-field-hook
18+
spec:
19+
affinity:
20+
nodeAffinity:
21+
requiredDuringSchedulingIgnoredDuringExecution:
22+
nodeSelectorTerms:
23+
- matchExpressions:
24+
- key: foo
25+
operator: In
26+
values:
27+
- bar
28+
- baz
29+
env:
30+
- name: ATTRIBUTE_NAME
31+
value: category
32+
- name: ATTRIBUTE_VALUE
33+
value: my-own-category
34+
- name: foo
35+
value: bar
36+
image: docker.io/securecodebox/hook-update-field-hook:0.0.0
37+
imagePullSecrets:
38+
- name: foo
39+
priority: 100
40+
resources:
41+
requests:
42+
cpu: 100m
43+
memory: 100Mi
44+
tolerations:
45+
- effect: NoSchedule
46+
key: foo
47+
operator: Exists
48+
value: value1
49+
ttlSecondsAfterFinished: 100
50+
type: ReadAndWrite
51+
volumeMounts:
52+
- mountPath: /foo
53+
name: foo
54+
volumes:
55+
- emptyDir: {}
56+
name: foo
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
suite: Full Snapshot
2+
3+
tests:
4+
- it: matches the snapshot
5+
chart:
6+
version: 0.0.0
7+
appVersion: 0.0.0
8+
set:
9+
imagePullSecrets: [{name: foo}]
10+
hook:
11+
labels: {foo: bar}
12+
annotations: {foo: bar}
13+
priority: 100
14+
ttlSecondsAfterFinished: 100
15+
tolerations:
16+
[{key: foo, operator: Exists, value: "value1", effect: NoSchedule}]
17+
affinity:
18+
nodeAffinity:
19+
requiredDuringSchedulingIgnoredDuringExecution:
20+
nodeSelectorTerms:
21+
- matchExpressions:
22+
- {key: foo, operator: In, values: [bar, baz]}
23+
resources: {requests: {cpu: "100m", memory: "100Mi"}}
24+
extraVolumes: [{name: foo, emptyDir: {}}]
25+
extraVolumeMounts: [{name: foo, mountPath: /foo}]
26+
env: [{name: foo, value: bar}]
27+
asserts:
28+
- matchSnapshot: {}

0 commit comments

Comments
 (0)