Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-8858

PAC: git-clone task uses tekton hub instead of artifact hub

XMLWordPrintable

      Description of problem:

      Pipelinerun created from generate pipelinerun yaml uses URL https://api.hub.tekton.dev/v1/api/v1/packages/tekton-task/pacpipelines/git-clone, as it should fetch from artifacthub api url instead of api.hub.tekton.dev

      Prerequisites (if any, like setup, operators/versions):

      1.20.0

      Steps to Reproduce

      Install 1.20.0

      Create pipeline run yaml and set up PAC

      Trigger the pipeline run from GitLab 

      Actual results:

      Pipelines as Code CI has failed
      There was an issue validating the commit: "error getting remote task from pipelinerun annotations: error getting remote task "git-clone": could not fetch remote task git-clone, artifacthub API returned: could not fetch task git-clone from hub, url: https://api.hub.tekton.dev/v1/api/v1/packages/tekton-task/pacpipelines/git-clone: Non-OK HTTP status: 404" 

      Expected results:

      Pipelinerun is passed

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Additional info (Such as Logs, Screenshots, etc):

      ---
      apiVersion: tekton.dev/v1
      kind: PipelineRun
      metadata:
        name: release-tests-fork-68168267-pull-request
        annotations:
          # The event we are targeting as seen from the webhook payload
          # this can be an array too, i.e: [pull_request, push]
          pipelinesascode.tekton.dev/on-event: "[pull_request]"    # The branch or tag we are targeting (ie: main, refs/tags/*)
          pipelinesascode.tekton.dev/on-target-branch: "[main]"    # Fetch the git-clone task from hub, we are able to reference later on it
          # with taskRef and it will automatically be embedded into our pipeline.
          pipelinesascode.tekton.dev/task: "git-clone"    # Use maven task from hub
          #
          # pipelinesascode.tekton.dev/task-1: "maven"    # You can add more tasks by increasing the suffix number, you can specify them as array to have multiple of them.
          # browse the tasks you want to include from hub on https://hub.tekton.dev/
          #
          # pipelinesascode.tekton.dev/task-2: "[curl, buildah]"    # How many runs we want to keep.
          pipelinesascode.tekton.dev/max-keep-runs: "5"
      spec:
        params:
          # The variable with brackets are special to Pipelines as Code
          # They will automatically be expanded with the events from Github.
          - name: repo_url
            value: "{{ repo_url }}"
          - name: revision
            value: "{{ revision }}"
        pipelineSpec:
          params:
            - name: repo_url
            - name: revision
          workspaces:
            - name: source
            - name: basic-auth
          tasks:
            - name: fetch-repository
              taskRef:
                name: git-clone
              workspaces:
                - name: output
                  workspace: source
                - name: basic-auth
                  workspace: basic-auth
              params:
                - name: url
                  value: $(params.repo_url)
                - name: revision
                  value: $(params.revision)
            # Customize this task if you like, or just do a taskRef
            # to one of the hub task.
            - name: noop-task
              displayName: Task with no effect
              runAfter:
                - fetch-repository
              workspaces:
                - name: source
                  workspace: source
              taskSpec:
                workspaces:
                  - name: source
                steps:
                  - name: noop-task
                    image: registry.access.redhat.com/ubi9/ubi-micro
                    workingDir: $(workspaces.source.path)
                    script: |
                      exit 0
        workspaces:
          - name: source
            volumeClaimTemplate:
              spec:
                accessModes:
                  - ReadWriteOnce
                resources:
                  requests:
                    storage: 1Gi
          # This workspace will inject secret to help the git-clone task to be able to
          # checkout the private repositories
          - name: basic-auth
            secret:
              secretName: "{{ git_auth_secret }}"
      

       *

              shverma Shiv Verma
              rhn-support-sselvan Sri Vignesh Selvan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: