1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

Update kuttl test scaffolding (#5303)

* add test instructions

Signed-off-by: Chip Zoller <chipzoller@gmail.com>

* update scaffolding

Signed-off-by: Chip Zoller <chipzoller@gmail.com>

Signed-off-by: Chip Zoller <chipzoller@gmail.com>
Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
This commit is contained in:
Chip Zoller 2022-11-10 09:25:51 -05:00 committed by GitHub
parent 7a15231a1c
commit 67f7d7af24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 7 deletions

View file

@ -1,6 +1,6 @@
# Some Best Practices
* Don't put anything in index `00` so it can be used in the future.
* Put clean-up as index `99` so it's always last no matter how many steps.
* A final clean-up stage/file is not needed unless a resource was created using a Script. Use scripts sparingly!
* The `*-errors.yaml` file, like an `*-assert.yaml` file only performs an existence check, not a creation check.
* One test can contain both positive and negative tests by extending the test case. No need to write separate.

View file

@ -0,0 +1,6 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
apply:
- policy.yaml
assert:
- policy-ready.yaml

View file

@ -0,0 +1,6 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
apply:
- resource.yaml
assert:
- resource-mutated.yaml

View file

@ -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

View file

@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: testingsecret
namespace: default
labels:
foo: bar