tekton-lint icon indicating copy to clipboard operation
tekton-lint copied to clipboard

Bindings need to be an array not object

Open kirrg001 opened this issue 1 year ago • 1 comments

Describe the bug

I received a 500 from the backend with this syntax:

spec:
  triggers:
    - bindings:
        name: github-pr-binding
      template:
        name: pr-template
with pipelineId: c2cd6a8d-ea5a-47b0-913e-cd172d63833f, transactionId: d0a52994-03da-4841-9a45-8e6d375fbb19, error: (trigger.bindings || (trigger.binding && [trigger.binding]) || []).forEach is not a function at TypeError: (trigger.bindings || (trigger.binding && [trigger.binding]) || []).forEach is not a function
    at Object.getTemplatedResources (/home/node/lib/pipelineutil.js:708:76)

To Reproduce

spec:
  triggers:
    - bindings:
        name: github-pr-binding
      template:
        name: pr-template

Expected behavior

I expected a linting error. I expected a proper error handling in the backend.

The fix

spec:
  triggers:
    - bindings:
        - name: github-pr-binding
      template:
        name: pr-template

Thank you :)

kirrg001 avatar Feb 13 '24 10:02 kirrg001

thanks for the report!

mbwhite avatar Feb 13 '24 14:02 mbwhite