Assert¶
The assert
operation allows you to specify conditions that should hold true for a successful test.
For example, after applying resources, you might want to ensure that a particular pod is running or a service is accessible.
Assertion trees
Assertions in Chainsaw are based on assertion trees.
Assertion trees are a solution to declaratively represent complex conditions like partial array comparisons or complex operations against an incoming data structure.
Assertion trees are compatible with standard assertions that exist in tools like KUTTL but can do a lot more. Please see the assertion trees documentation in kyverno-json for details.
Configuration¶
Reference documentation
Usage examples¶
Below is an example of using assert
in a Test
resource.
Using a specific file for assertions
Using file path expressions for assertions
Using an URL