mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-28 02:18:15 +00:00
[Fix] flakes in e2e tests (#8253)
* fix small errors Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com> * fix ns Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com> * fixes Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com> * drop sleep Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com> * update readme Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com> * typo Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com> * fixes Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com> * intendation Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com> --------- Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
90d84d81b2
commit
d615826a9e
9 changed files with 38 additions and 6 deletions
|
@ -1,6 +1,4 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
apply:
|
||||
- pod.yaml
|
||||
assert:
|
||||
- pod-assert.yaml
|
||||
- pod.yaml
|
6
test/conformance/kuttl/ttl/past-timestamp/02-check.yaml
Normal file
6
test/conformance/kuttl/ttl/past-timestamp/02-check.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: sleep 5
|
||||
error:
|
||||
- pod-assert.yaml
|
6
test/conformance/kuttl/ttl/past-timestamp/03-pod.yaml
Normal file
6
test/conformance/kuttl/ttl/past-timestamp/03-pod.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
apply:
|
||||
- pod-2.yaml
|
||||
assert:
|
||||
- pod-assert-2.yaml
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: sleep 5
|
||||
apply:
|
||||
- past-timestamp.yaml
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
error:
|
||||
- pod-assert.yaml
|
||||
- pod-assert-2.yaml
|
|
@ -6,4 +6,8 @@ This test cleans up pods instanteaously without any delay as the value of the la
|
|||
|
||||
The pod `test-pod` is cleaned up instantaneously.
|
||||
|
||||
The pod `test-pod-2` is cleaned up instantaneously when the label is updated to `cleanup.kyverno.io/ttl: 2023-07-19T120000Z` the timestamp is mentioned in past.
|
||||
|
||||
## Reference Issue(s)
|
||||
|
||||
- [8242](https://github.com/kyverno/kyverno/issues/8242): `test-pod` might never be created, so the assert could fail.
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: test-pod-2
|
||||
labels:
|
||||
cleanup.kyverno.io/ttl: 2023-07-19T120000Z
|
8
test/conformance/kuttl/ttl/past-timestamp/pod-2.yaml
Normal file
8
test/conformance/kuttl/ttl/past-timestamp/pod-2.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: test-pod-2
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx:latest
|
||||
name: nginx
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: test-pod-2
|
Loading…
Add table
Reference in a new issue