Labels selector¶
Test steps:
- Creates a ConfigMap
- Asserts the ConfigMap contains the expected data
This test is similar to the basic example but Chainsaw is invoked with the --selector
flag.
Setup¶
See Setup docs
Manifests¶
resources.yaml
¶
assertions.yaml
¶
Test¶
chainsaw-test.yaml
¶
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: labels-selector
labels:
# test labels
test-suite: examples
spec:
steps:
- try:
- apply:
file: resources.yaml
- assert:
file: assertions.yaml