From 396282ab77da404ca001ba252844a05170192843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Mon, 3 Apr 2023 19:35:38 +0200 Subject: [PATCH] chore: remove unnecessary cleanup steps from kuttl tests (#6771) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .../multiple-attestors/99-cleanup.yaml | 4 ---- .../configmap-context-lookup/99-cleanup.yaml | 4 ---- .../imageExtractors-complex/02-create-task.yaml | 15 +++------------ .../imageExtractors-simple/02-create-task.yaml | 15 +++------------ .../standard/keyed-basic/99-cleanup.yaml | 4 ---- .../standard/keyed-secret/99-cleanup.yaml | 4 ---- .../99-cleanup.yaml | 4 ---- .../99-cleanup.yaml | 4 ---- .../02-pod.yaml | 5 +++++ .../02-script.yaml | 14 -------------- .../99-cleanup.yaml | 4 ---- .../99-cleanup.yaml | 4 ---- .../99-cleanup.yaml | 4 ---- .../02-pod.yaml | 5 +++++ .../02-script.yaml | 14 -------------- .../99-cleanup.yaml | 4 ---- .../02-pod.yaml | 5 +++++ .../02-script.yaml | 14 -------------- .../99-cleanup.yaml | 4 ---- .../99-cleanup.yaml | 4 ---- .../99-cleanup.yaml | 4 ---- .../99-cleanup.yaml | 4 ---- .../99-cleanup.yaml | 4 ---- .../errors.yaml | 7 ------- .../resource.yaml | 8 -------- .../script-check-for-error.yaml | 14 -------------- .../03-create-bad-pod.yaml | 13 +++---------- .../noconfigmap-diffimage-success/99-cleanup.yaml | 4 ---- .../04-create-badpod.yaml | 13 +++---------- .../99-cleanup.yaml | 4 ---- .../errors.yaml | 7 ------- 31 files changed, 27 insertions(+), 190 deletions(-) delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/cornercases/multiple-attestors/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/configmap-context-lookup/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyed-basic/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyed-secret/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-1/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-2/99-cleanup.yaml create mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/02-pod.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/02-script.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-4/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-1/99-cleanup.yaml create mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/02-pod.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/02-script.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/99-cleanup.yaml create mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/02-pod.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/02-script.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-mutatedigest-verifydigest-required/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-nomutatedigest-noverifydigest-norequired/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-nomutatedigest-noverifydigest-required/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/errors.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/resource.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/script-check-for-error.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/noconfigmap-diffimage-success/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/99-cleanup.yaml delete mode 100644 test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/errors.yaml diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/cornercases/multiple-attestors/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/cornercases/multiple-attestors/99-cleanup.yaml deleted file mode 100644 index 893aa6f305..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/cornercases/multiple-attestors/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-policy.yaml,02-pod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/configmap-context-lookup/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/configmap-context-lookup/99-cleanup.yaml deleted file mode 100644 index 15c3c49051..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/configmap-context-lookup/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/imageExtractors-complex/02-create-task.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/imageExtractors-complex/02-create-task.yaml index 850b8c6eb6..6215a089ae 100644 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/imageExtractors-complex/02-create-task.yaml +++ b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/imageExtractors-complex/02-create-task.yaml @@ -1,14 +1,5 @@ -## Checks that the manifests.yaml file CANNOT be successfully created. If it can, fail the test as this is incorrect. - apiVersion: kuttl.dev/v1beta1 kind: TestStep -commands: -- script: | - if kubectl apply -f badtask.yaml - then - echo "Tested failed. Task was created when it shouldn't have been." - exit 1 - else - echo "Test succeeded. Task was not created as intended." - exit 0 - fi \ No newline at end of file +apply: +- file: badtask.yaml + shouldFail: true diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/imageExtractors-simple/02-create-task.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/imageExtractors-simple/02-create-task.yaml index 850b8c6eb6..6215a089ae 100644 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/imageExtractors-simple/02-create-task.yaml +++ b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/imageExtractors-simple/02-create-task.yaml @@ -1,14 +1,5 @@ -## Checks that the manifests.yaml file CANNOT be successfully created. If it can, fail the test as this is incorrect. - apiVersion: kuttl.dev/v1beta1 kind: TestStep -commands: -- script: | - if kubectl apply -f badtask.yaml - then - echo "Tested failed. Task was created when it shouldn't have been." - exit 1 - else - echo "Test succeeded. Task was not created as intended." - exit 0 - fi \ No newline at end of file +apply: +- file: badtask.yaml + shouldFail: true diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyed-basic/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyed-basic/99-cleanup.yaml deleted file mode 100644 index 61b7555976..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyed-basic/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-goodpod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyed-secret/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyed-secret/99-cleanup.yaml deleted file mode 100644 index 61b7555976..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyed-secret/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-goodpod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-1/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-1/99-cleanup.yaml deleted file mode 100644 index 1f710a50a6..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-1/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-pod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-2/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-2/99-cleanup.yaml deleted file mode 100644 index 1f710a50a6..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-2/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-pod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/02-pod.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/02-pod.yaml new file mode 100644 index 0000000000..b84fa7138a --- /dev/null +++ b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/02-pod.yaml @@ -0,0 +1,5 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- file: pod.yaml + shouldFail: true diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/02-script.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/02-script.yaml deleted file mode 100644 index 0b044d4860..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/02-script.yaml +++ /dev/null @@ -1,14 +0,0 @@ -## Checks that the manifests.yaml file CANNOT be successfully created. If it can, fail the test as this is incorrect. - -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: -- script: | - if kubectl apply -f pod.yaml - then - echo "Tested failed. Resource was allowed." - exit 1 - else - echo "Test succeeded. Resource was blocked." - exit 0 - fi \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/99-cleanup.yaml deleted file mode 100644 index 15c3c49051..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-3/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-4/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-4/99-cleanup.yaml deleted file mode 100644 index 1f710a50a6..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-4/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-pod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-1/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-1/99-cleanup.yaml deleted file mode 100644 index 1f710a50a6..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-1/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-pod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/02-pod.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/02-pod.yaml new file mode 100644 index 0000000000..b84fa7138a --- /dev/null +++ b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/02-pod.yaml @@ -0,0 +1,5 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- file: pod.yaml + shouldFail: true diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/02-script.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/02-script.yaml deleted file mode 100644 index 0b044d4860..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/02-script.yaml +++ /dev/null @@ -1,14 +0,0 @@ -## Checks that the manifests.yaml file CANNOT be successfully created. If it can, fail the test as this is incorrect. - -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: -- script: | - if kubectl apply -f pod.yaml - then - echo "Tested failed. Resource was allowed." - exit 1 - else - echo "Test succeeded. Resource was blocked." - exit 0 - fi \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/99-cleanup.yaml deleted file mode 100644 index 15c3c49051..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-2/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/02-pod.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/02-pod.yaml new file mode 100644 index 0000000000..b84fa7138a --- /dev/null +++ b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/02-pod.yaml @@ -0,0 +1,5 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- file: pod.yaml + shouldFail: true diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/02-script.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/02-script.yaml deleted file mode 100644 index 0b044d4860..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/02-script.yaml +++ /dev/null @@ -1,14 +0,0 @@ -## Checks that the manifests.yaml file CANNOT be successfully created. If it can, fail the test as this is incorrect. - -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: -- script: | - if kubectl apply -f pod.yaml - then - echo "Tested failed. Resource was allowed." - exit 1 - else - echo "Test succeeded. Resource was blocked." - exit 0 - fi \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/99-cleanup.yaml deleted file mode 100644 index 15c3c49051..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-attestations-multiple-subjects-counts-3/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-mutatedigest-verifydigest-required/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-mutatedigest-verifydigest-required/99-cleanup.yaml deleted file mode 100644 index 1f710a50a6..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-mutatedigest-verifydigest-required/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-pod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-nomutatedigest-noverifydigest-norequired/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-nomutatedigest-noverifydigest-norequired/99-cleanup.yaml deleted file mode 100644 index 1f710a50a6..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-nomutatedigest-noverifydigest-norequired/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-pod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-nomutatedigest-noverifydigest-required/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-nomutatedigest-noverifydigest-required/99-cleanup.yaml deleted file mode 100644 index 1f710a50a6..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/keyless-nomutatedigest-noverifydigest-required/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-pod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/99-cleanup.yaml deleted file mode 100644 index 1f710a50a6..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-pod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/errors.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/errors.yaml deleted file mode 100644 index dcb47a5770..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/errors.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: testingsecret - namespace: default - labels: - foo: bar \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/resource.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/resource.yaml deleted file mode 100644 index cfafb7c22b..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/resource.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -data: - foo: YmFy -kind: Secret -metadata: - name: testingsecret - namespace: default -type: Opaque \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/script-check-for-error.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/script-check-for-error.yaml deleted file mode 100644 index 2886015091..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/mutateDigest-noverifyDigest-norequired/script-check-for-error.yaml +++ /dev/null @@ -1,14 +0,0 @@ -## Checks that the manifests.yaml file CANNOT be successfully created. If it can, fail the test as this is incorrect. - -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: -- script: | - if kubectl apply -f manifests.yaml - then - echo "Tested failed. Policy was created when it shouldn't have been." - exit 1 - else - echo "Test succeeded. Policy was not created as intended." - exit 0 - fi \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/noconfigmap-diffimage-success/03-create-bad-pod.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/noconfigmap-diffimage-success/03-create-bad-pod.yaml index 55c88c1d4c..b48ec6df7c 100644 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/noconfigmap-diffimage-success/03-create-bad-pod.yaml +++ b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/noconfigmap-diffimage-success/03-create-bad-pod.yaml @@ -1,12 +1,5 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep -commands: -- script: | - if kubectl apply -f bad-pod.yaml - then - echo "Tested failed. Pod was created when it shouldn't have been." - exit 1 - else - echo "Test succeeded. Pod was not created as intended." - exit 0 - fi +apply: +- file: bad-pod.yaml + shouldFail: true diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/noconfigmap-diffimage-success/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/noconfigmap-diffimage-success/99-cleanup.yaml deleted file mode 100644 index 647f01355a..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/noconfigmap-diffimage-success/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f policy.yaml,good-pod.yaml,pod-with-configmap.yaml,namespace.yaml --force --wait=true --ignore-not-found=true diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/04-create-badpod.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/04-create-badpod.yaml index e8c31676e8..349ccfa153 100644 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/04-create-badpod.yaml +++ b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/04-create-badpod.yaml @@ -2,13 +2,6 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep -commands: -- script: | - if kubectl apply -f badpod.yaml - then - echo "Tested failed. Bad pod was created when it shouldn't have been." - exit 1 - else - echo "Test succeeded. Bad pod was not created as intended." - exit 0 - fi \ No newline at end of file +apply: +- file: badpod.yaml + shouldFail: true diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/99-cleanup.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/99-cleanup.yaml deleted file mode 100644 index 61b7555976..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/99-cleanup.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete -f 01-manifests.yaml,02-goodpod.yaml --force --wait=true --ignore-not-found=true \ No newline at end of file diff --git a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/errors.yaml b/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/errors.yaml deleted file mode 100644 index dcb47a5770..0000000000 --- a/test/conformance/kuttl/verifyImages/clusterpolicy/standard/nomutateDigest-verifyDigest-norequired/errors.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: testingsecret - namespace: default - labels: - foo: bar \ No newline at end of file