diff --git a/test/conformance/kuttl/ttl/delete-twice/01-pod.yaml b/test/conformance/kuttl/ttl/delete-twice/01-pod.yaml new file mode 100644 index 0000000000..52ffd92005 --- /dev/null +++ b/test/conformance/kuttl/ttl/delete-twice/01-pod.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- pod.yaml +assert: +- pod-assert.yaml \ No newline at end of file diff --git a/test/conformance/kuttl/ttl/delete-twice/02-check.yaml b/test/conformance/kuttl/ttl/delete-twice/02-check.yaml new file mode 100644 index 0000000000..024ee4f1b4 --- /dev/null +++ b/test/conformance/kuttl/ttl/delete-twice/02-check.yaml @@ -0,0 +1,4 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +error: +- pod-assert.yaml \ No newline at end of file diff --git a/test/conformance/kuttl/ttl/delete-twice/03-pod.yaml b/test/conformance/kuttl/ttl/delete-twice/03-pod.yaml new file mode 100644 index 0000000000..52ffd92005 --- /dev/null +++ b/test/conformance/kuttl/ttl/delete-twice/03-pod.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- pod.yaml +assert: +- pod-assert.yaml \ No newline at end of file diff --git a/test/conformance/kuttl/ttl/delete-twice/04-check.yaml b/test/conformance/kuttl/ttl/delete-twice/04-check.yaml new file mode 100644 index 0000000000..024ee4f1b4 --- /dev/null +++ b/test/conformance/kuttl/ttl/delete-twice/04-check.yaml @@ -0,0 +1,4 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +error: +- pod-assert.yaml \ No newline at end of file diff --git a/test/conformance/kuttl/ttl/delete-twice/README.md b/test/conformance/kuttl/ttl/delete-twice/README.md new file mode 100644 index 0000000000..fb565cce6e --- /dev/null +++ b/test/conformance/kuttl/ttl/delete-twice/README.md @@ -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) diff --git a/test/conformance/kuttl/ttl/delete-twice/pod-assert.yaml b/test/conformance/kuttl/ttl/delete-twice/pod-assert.yaml new file mode 100644 index 0000000000..06ec46e3f4 --- /dev/null +++ b/test/conformance/kuttl/ttl/delete-twice/pod-assert.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Pod +metadata: + name: test-pod + labels: + cleanup.kyverno.io/ttl: 10s \ No newline at end of file diff --git a/test/conformance/kuttl/ttl/delete-twice/pod.yaml b/test/conformance/kuttl/ttl/delete-twice/pod.yaml new file mode 100644 index 0000000000..5218083366 --- /dev/null +++ b/test/conformance/kuttl/ttl/delete-twice/pod.yaml @@ -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