Skip to content

Instantly share code, notes, and snippets.

@pritidesai
Created September 14, 2021 18:32
Show Gist options
  • Save pritidesai/11d1d7a8af624f21d59b5e57907bd8c8 to your computer and use it in GitHub Desktop.
Save pritidesai/11d1d7a8af624f21d59b5e57907bd8c8 to your computer and use it in GitHub Desktop.
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: pipelinerun-with-taskspec-to-echo-greetings
spec:
  pipelineSpec:
    params:
      - name: GREETINGS
        description: "Greetings, default is Hello World!"
        type: string
        default: "Hello World!"
    tasks:
      - name: echo-greetings
        taskSpec:
          params:
          - name: MESSAGE
            type: string
            default: "Hello World!"
          steps:
            - name: echo
              image: ubuntu
              script: |
                #!/usr/bin/env bash
                echo "$(params.MESSAGE)"
        params:
          - name: MESSAGE
            value: $(params.GREETINGS)

resolves to:

spec:
  pipelineSpec:
    params:
    - default: Hello World!
      description: Greetings, default is Hello World!
      name: GREETINGS
      type: string
    tasks:
    - name: echo-greetings
      params:
      - name: MESSAGE
        value: $(params.GREETINGS)
      - name: GREETINGS
        value: $(params.GREETINGS)
      taskSpec:
        metadata: {}
        params:
        - default: Hello World!
          description: Greetings, default is Hello World!
          name: GREETINGS
          type: string
        - default: Hello World!
          name: MESSAGE
          type: string
        spec: null
        steps:
        - image: ubuntu
          name: echo
          resources: {}
          script: |
            #!/usr/bin/env bash
            echo "$(params.MESSAGE)"

Before PR #4127:

spec:
  pipelineSpec:
    params:
    - default: Hello World!
      description: Greetings, default is Hello World!
      name: GREETINGS
      type: string
    tasks:
    - name: echo-greetings
      params:
      - name: MESSAGE
        value: $(params.GREETINGS)
      taskSpec:
        metadata: {}
        params:
        - default: Hello World!
          name: MESSAGE
          type: string
        spec: null
        steps:
        - image: ubuntu
          name: echo
          resources: {}
          script: |
            #!/usr/bin/env bash
            echo "$(params.MESSAGE)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment