Skip to content

Work with label selectors

Chainsaw can filter the tests to run using label selectors.

You can pass label selectors using the --selector flag when invoking the chainsaw test command.

Given the test below:

apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
  name: basic
  labels:
    foo: bar
spec:
  # ...

Invoking Chainsaw with the command below will take the test above into account:

chainsaw test --selector foo=bar