diff --git a/test/conformance/chainsaw/ttl/propagation-policy/background/chainsaw-test.yaml b/test/conformance/chainsaw/ttl/propagation-policy/background/chainsaw-test.yaml new file mode 100644 index 0000000000..c8c7f669e3 --- /dev/null +++ b/test/conformance/chainsaw/ttl/propagation-policy/background/chainsaw-test.yaml @@ -0,0 +1,22 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: background +spec: + steps: + - name: Create job with background deletion policy + try: + - create: + file: job.yaml + - name: Wait pod is running + try: + - assert: + file: pod-assert.yaml + - name: Delete job with background deletion policy + try: + - delete: + file: job.yaml + - name: Assert pod is no longer running + try: + - error: + file: pod-assert.yaml diff --git a/test/conformance/chainsaw/ttl/propagation-policy/background/job.yaml b/test/conformance/chainsaw/ttl/propagation-policy/background/job.yaml new file mode 100644 index 0000000000..41a5fac371 --- /dev/null +++ b/test/conformance/chainsaw/ttl/propagation-policy/background/job.yaml @@ -0,0 +1,17 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: job + annotations: + cleanup.kyverno.io/propagation-policy: Background +spec: + template: + spec: + restartPolicy: Never + containers: + - name: main + image: docker.io/library/bash:5 + command: ["bash"] + args: + - -c + - sleep 120s diff --git a/test/conformance/chainsaw/ttl/propagation-policy/background/pod-assert.yaml b/test/conformance/chainsaw/ttl/propagation-policy/background/pod-assert.yaml new file mode 100644 index 0000000000..35f86072a7 --- /dev/null +++ b/test/conformance/chainsaw/ttl/propagation-policy/background/pod-assert.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Pod +status: + phase: Running diff --git a/test/conformance/chainsaw/ttl/propagation-policy/foreground/chainsaw-test.yaml b/test/conformance/chainsaw/ttl/propagation-policy/foreground/chainsaw-test.yaml new file mode 100644 index 0000000000..7cbcadb4c8 --- /dev/null +++ b/test/conformance/chainsaw/ttl/propagation-policy/foreground/chainsaw-test.yaml @@ -0,0 +1,22 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: foreground +spec: + steps: + - name: Create job with foreground deletion policy + try: + - create: + file: job.yaml + - name: Wait pod is running + try: + - assert: + file: pod-assert.yaml + - name: Delete job with foreground deletion policy + try: + - delete: + file: job.yaml + - name: Assert pod is no longer running + try: + - error: + file: pod-assert.yaml diff --git a/test/conformance/chainsaw/ttl/propagation-policy/foreground/job.yaml b/test/conformance/chainsaw/ttl/propagation-policy/foreground/job.yaml new file mode 100644 index 0000000000..55e805bd11 --- /dev/null +++ b/test/conformance/chainsaw/ttl/propagation-policy/foreground/job.yaml @@ -0,0 +1,17 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: job + annotations: + cleanup.kyverno.io/propagation-policy: Foreground +spec: + template: + spec: + restartPolicy: Never + containers: + - name: main + image: docker.io/library/bash:5 + command: ["bash"] + args: + - -c + - sleep 120s diff --git a/test/conformance/chainsaw/ttl/propagation-policy/foreground/pod-assert.yaml b/test/conformance/chainsaw/ttl/propagation-policy/foreground/pod-assert.yaml new file mode 100644 index 0000000000..0c784d0c93 --- /dev/null +++ b/test/conformance/chainsaw/ttl/propagation-policy/foreground/pod-assert.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: Pod +status: + phase: Running + \ No newline at end of file diff --git a/test/conformance/chainsaw/ttl/propagation-policy/orphan/chainsaw-test.yaml b/test/conformance/chainsaw/ttl/propagation-policy/orphan/chainsaw-test.yaml new file mode 100644 index 0000000000..e237c3d97a --- /dev/null +++ b/test/conformance/chainsaw/ttl/propagation-policy/orphan/chainsaw-test.yaml @@ -0,0 +1,22 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: orphan +spec: + steps: + - name: Create job with orphan deletion policy + try: + - create: + file: job.yaml + - name: Wait pod is running + try: + - assert: + file: pod-assert.yaml + - name: Delete job + try: + - delete: + file: job.yaml + - name: Assert pod is still running + try: + - assert: + file: pod-assert.yaml diff --git a/test/conformance/chainsaw/ttl/propagation-policy/orphan/job.yaml b/test/conformance/chainsaw/ttl/propagation-policy/orphan/job.yaml new file mode 100644 index 0000000000..77dd649ddb --- /dev/null +++ b/test/conformance/chainsaw/ttl/propagation-policy/orphan/job.yaml @@ -0,0 +1,17 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: job + annotations: + cleanup.kyverno.io/propagation-policy: Orphan +spec: + template: + spec: + restartPolicy: Never + containers: + - name: main + image: docker.io/library/bash:5 + command: ["bash"] + args: + - -c + - sleep 120s diff --git a/test/conformance/chainsaw/ttl/propagation-policy/orphan/pod-assert.yaml b/test/conformance/chainsaw/ttl/propagation-policy/orphan/pod-assert.yaml new file mode 100644 index 0000000000..35f86072a7 --- /dev/null +++ b/test/conformance/chainsaw/ttl/propagation-policy/orphan/pod-assert.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Pod +status: + phase: Running