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

Tekton Bundle resolver doesn't seem to be supported

Open Allda opened this issue 10 months ago • 0 comments

Describe the bug When running a linter against my pipeline definition I am getting the following error:

index-img-signing-pipeline.yml
  0:0  error  Pipeline 'index-img-signing-pipeline' references task 'undefined' but the referenced task cannot be found. To fix this, include all the task definitions to the lint task for this pipeline  no-missing-resource


15:35:00.131] ERROR (31707): Cannot read properties of undefined (reading 'key')
    err: {
      "type": "TypeError",
      "message": "Cannot read properties of undefined (reading 'key')",
      "stack":
          TypeError: Cannot read properties of undefined (reading 'key')
              at Reporter._getLocationAVL (file:///home/araszka/workspace/operator-pipelines/node_modules/@ibm/tekton-lint/src/reporter.ts:181:77)
              at Reporter.report (file:///home/araszka/workspace/operator-pipelines/node_modules/@ibm/tekton-lint/src/reporter.ts:117:24)
              at file:///home/araszka/workspace/operator-pipelines/node_modules/@ibm/tekton-lint/src/rules.ts:10:18
              at default (file:///home/araszka/workspace/operator-pipelines/node_modules/@ibm/tekton-lint/src/rules/no-missing-resource.ts:81:21)
              at lint (file:///home/araszka/workspace/operator-pipelines/node_modules/@ibm/tekton-lint/src/rules.ts:67:9)
              at runner (file:///home/araszka/workspace/operator-pipelines/node_modules/@ibm/tekton-lint/src/runner.ts:43:16)
              at file:///home/araszka/workspace/operator-pipelines/node_modules/@ibm/tekton-lint/src/lint.ts:61:26
    }

After further inspection it seems the linter always expects a task name to be defined in the pipeline and it doesn't support Tekton bundles references - https://tekton.dev/docs/pipelines/bundle-resolver/

To Reproduce Create a Tekton pipeline and include a task that is referenced as Tekton bundle:

npx @ibm/tekton-lint@latest "index-img-signing-pipeline.yml"
tasks:
    - name: verify-whitelisted-index-image
      taskRef:
        resolver: bundles
        params:
          - name: bundle
            value: "quay.io/redhat-isv/tkn-signing-bundle:4692680007"
          - name: name
            value: verify-whitelisted-index-image
          - name: kind
            value: Task
      params:
        - name: reference
          value: $(params.reference)

Expected behavior A linter should be able to recognize bundle resolver usage and check the task/pipeline accordingly.

Screenshots

Must gather (please complete the following information):

  • SDK Version [e.g. 1.2.1]
  • Node.js Version: v20.18.1

Allda avatar Feb 10 '25 15:02 Allda