mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-30 19:35:06 +00:00
test: add test to cleanup the same resource twice (#7965)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
64a555a25d
commit
e9c8a3da0a
7 changed files with 46 additions and 0 deletions
6
test/conformance/kuttl/ttl/delete-twice/01-pod.yaml
Normal file
6
test/conformance/kuttl/ttl/delete-twice/01-pod.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
apply:
|
||||
- pod.yaml
|
||||
assert:
|
||||
- pod-assert.yaml
|
4
test/conformance/kuttl/ttl/delete-twice/02-check.yaml
Normal file
4
test/conformance/kuttl/ttl/delete-twice/02-check.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
error:
|
||||
- pod-assert.yaml
|
6
test/conformance/kuttl/ttl/delete-twice/03-pod.yaml
Normal file
6
test/conformance/kuttl/ttl/delete-twice/03-pod.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
apply:
|
||||
- pod.yaml
|
||||
assert:
|
||||
- pod-assert.yaml
|
4
test/conformance/kuttl/ttl/delete-twice/04-check.yaml
Normal file
4
test/conformance/kuttl/ttl/delete-twice/04-check.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
error:
|
||||
- pod-assert.yaml
|
10
test/conformance/kuttl/ttl/delete-twice/README.md
Normal file
10
test/conformance/kuttl/ttl/delete-twice/README.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
# ## Description
|
||||
|
||||
This test cleans up pods via a label assignment named `cleanup.kyverno.io/ttl: 10s`.
|
||||
Once deleted, the pod is created a second time and we expect to be deleted again.
|
||||
|
||||
## Expected Behavior
|
||||
|
||||
The pod `test-pod` is cleaned up successfully after 10s twice.
|
||||
|
||||
## Reference Issue(s)
|
6
test/conformance/kuttl/ttl/delete-twice/pod-assert.yaml
Normal file
6
test/conformance/kuttl/ttl/delete-twice/pod-assert.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: test-pod
|
||||
labels:
|
||||
cleanup.kyverno.io/ttl: 10s
|
10
test/conformance/kuttl/ttl/delete-twice/pod.yaml
Normal file
10
test/conformance/kuttl/ttl/delete-twice/pod.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: test-pod
|
||||
labels:
|
||||
cleanup.kyverno.io/ttl: 10s
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx:latest
|
||||
name: nginx
|
Loading…
Add table
Reference in a new issue