Passing data to tests¶
Chainsaw can pass arbitrary values when running tests using the --values
flag. Values will be available to tests under the $values
binding.
This is useful when a test needs to be configured externally.
Example¶
The test below expects the $value.foo
to be provided when chainsaw is invoked.
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: values
spec:
steps:
- try:
- assert:
resource:
($values.foo): bar
Now you can invoke chainsaw like this: