Finally¶
A finally
statement is similar to a catch statement but will always execute after the try and eventual catch statements finished executing regardless of the success or failure of the test step.
Tip
All operations and collectors of a finally
statement will be executed regardless of the success or failure of each of them.
Operations¶
A finally
statement supports only the following operations:
Collectors¶
A finally
statement supports all collectors:
Example¶
Example
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: example
spec:
steps:
- try: []
catch: []
finally:
- command:
# ...
- script:
# ...
- delete:
# ...
- events:
# ...
- podLogs:
# ...
- describe:
# ...
- get:
# ...
- sleep:
# ...