Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report missing parameter in TaskSpec (inline tasks) #61

Open
necccc opened this issue Nov 26, 2020 · 1 comment
Open

Report missing parameter in TaskSpec (inline tasks) #61

necccc opened this issue Nov 26, 2020 · 1 comment
Labels
good first issue Good for newcomers hacktoberfest Good issues for Hacktoberfest help wanted Extra attention is needed

Comments

@necccc
Copy link
Contributor

necccc commented Nov 26, 2020

In 0.5.2 we should report missing parameters in taskSpec tasks

Example:

    - name: inline-task
      params:
        - name: pipeline-debug
          value: $(params.pipeline-debug)
      workspaces:
        - name: secrets
          workspace: artifacts
      taskSpec:
        workspaces:
          - name: secrets
            mountPath: /secrets
        params:
          - name: pipeline-debug
        stepTemplate:
          env:
            - name: PIPELINE_RUN_ID
              valueFrom:
                fieldRef:
                  fieldPath: metadata.annotations['devops.cloud.ibm.com/tekton-pipeline']
        steps:
          - name: setup
            image: node:alpine
            script: |
              #!/bin/bash

              set -e -o pipefail

              if [ $PIPELINE_DEBUG == 1 ]; then
                pwd
                env
                trap env EXIT
                set -x
              fi

              export TOKEN=$(cat "/secrets/$(params.token)")

The line
export TOKEN=$(cat "/secrets/$(params.token)") use a parameter token which was not added nor provided for the task, the linter is missing this.

@mbwhite mbwhite added good first issue Good for newcomers help wanted Extra attention is needed hacktoberfest Good issues for Hacktoberfest labels Jan 10, 2024
@mbwhite
Copy link
Collaborator

mbwhite commented Jan 10, 2024

Hi - yes it's a good idea; at present there's only 1 rule that checks inside the body of the scripts.

To any contributors out there.. please have a go! thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest Good issues for Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants