apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
  name: single-signature
spec:
  steps:
  - name: create policy
    use:
      template: ../../_step-templates/create-policy.yaml
      with:
        bindings:
        - name: file
          value: policy.yaml
  - name: wait policy ready
    use:
      template: ../../_step-templates/cluster-policy-ready.yaml
      with:
        bindings:
        - name: name
          value: validate-yaml
  - name: step-02
    try:
    - apply:
        expect:
        - check:
            ($error != null): true
        file: resource-no-signature.yaml
    - apply:
        file: resource-one-signature.yaml
    - apply:
        file: resource-two-signatures.yaml
    - apply:
        expect:
        - check:
            ($error != null): true
        file: resource-bad-signatures.yaml