Delete¶
The delete
operation allows you to specify resources that should be deleted from the Kubernetes cluster before a particular test step is executed.
Info
The propagation policy is forced to Background
because some types default to Orphan
(this is the case for unmanaged jobs for example) and we don't want to let dangling pods run in the cluster after cleanup.
Configuration¶
Reference documentation
Usage examples¶
Below is an example of using delete
in a Test
resource.
Example
Operation check¶
Below is an example of using an operation check.
With check
# ...
- delete:
ref:
apiVersion: v1
kind: Pod
namespace: default
name: my-test-pod
expect:
- match:
# this check applies only if the match
# statement below evaluates to `true`
apiVersion: v1
kind: Pod
metadata:
namespace: default
name: my-test-pod
check:
# an error is expected, this will:
# - succeed if the operation failed
# - fail if the operation succeeded
($error != null): true
# ...