Skip to content

Commit

Permalink
chore: add test to cover the pod annotation for the kspm-collector
Browse files Browse the repository at this point in the history
  • Loading branch information
mavimo committed Oct 27, 2023
1 parent ec33a88 commit a72455d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions charts/kspm-collector/tests/pod_annotation_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
suite: Pod annotation test
templates:
- deployment.yaml
tests:
- it: check that the deployment do not have any custom annotation in the pod if not specified
set:
sysdig:
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
asserts:
- isNull:
path: spec.template.metadata.annotations

- it: check that the deployment include the pod annotation
set:
sysdig:
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
podAnnotations:
my-annotation: my-value
asserts:
- exists:
path: spec.template.metadata.annotations

- it: check that the deployment include the pod annotation match the value we specified
set:
sysdig:
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
podAnnotations:
my-annotation-1: my-value-1
my-annotation-2: my-value-2
asserts:
- equal:
path: spec.template.metadata.annotations['my-annotation-1']
value: my-value-1

- equal:
path: spec.template.metadata.annotations['my-annotation-2']
value: my-value-2

0 comments on commit a72455d

Please sign in to comment.