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

Skopeo-copy ClusterTask fails to copy images from ConfigMap

    XMLWordPrintable

Details

    • 1
    • False
    • None
    • False
    • Pipelines Sprint 245, Pipelines Sprint 246, Pipelines Sprint 247

    Description

      Description of problem:

      Hello,

      ClusterTask `skopeo-copy`, from the supported ClusterTasks contains a bug/typo that makes it fail with a not well-documented error.

      Basically, the task iterates through a ConfigMap containing a urls.txt file with the pattern:

      originURL1 destinationURL1
      originURL2 destinationURL2 
      originURL3 destinationURL3 

      Then, every line is added to `skopeo-copy "$cmd"`. As it has double quotes, the resulting command is:

      skopeo-copy "originURL1 destinationURL1" 

      which obviously fails, as skopeo-copy expects two different arguments, each with one URL, not only one argument with both.

      The solution is as simple as removing the double quotes. 

      This is the line of code: https://github.com/tektoncd/catalog/blob/main/task/skopeo-copy/0.2/skopeo-copy.yaml#L62

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

      Latest

      Steps to Reproduce

      1. Create a ConfigMap containing the URLs. For example:
      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: bulk-copy-images-configmap
        namespace: pipelines-test
      data:
        url.txt: |
          docker://registry.redhat.io/ubi8/openjdk-17:1.15 docker://quay.io/alopezme/openjdk-17:1.15
          docker://registry.redhat.io/ubi8/openjdk-17:1.15 docker://quay.io/alopezme/pipelines-test:1.15
      1. Create a Pipeline using the skopeo-copy ClusterTask:

       

      apiVersion: tekton.dev/v1beta1
      kind: Pipeline
      metadata:
        name: bulk-copy-images
        namespace: pipelines-test
      spec:
        tasks:
          - name: skopeo-copy
            params:
              - name: srcTLSverify
                value: 'true'
              - name: destTLSverify
                value: 'true'
            taskRef:
              kind: ClusterTask
              name: skopeo-copy
            workspaces:
              - name: images-url
                workspace: images-url
        workspaces:
          - name: images-url

       

      1. Create a PipelineRun invoking the Pipeline with the ConfigMap:{}
      apiVersion: tekton.dev/v1beta1
      kind: PipelineRun
      metadata:
        generateName: bulk-copy-images-
        namespace: pipelines-test
        labels:
          tekton.dev/pipeline: bulk-copy-images
      spec:
        pipelineRef:
          name: bulk-copy-images
        serviceAccountName: pipeline
        timeout: 1h0m0s
        workspaces:
          - name: images-url
            configMap:
              name: bulk-copy-images-configmap

      Actual results:

      It fails

      Expected results:

      To copy the images from one container registry to the other.

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

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

      Attachments

        Activity

          People

            piyushgarg001 Piyush Garg
            alvaro@redhat.com Álvaro López Medina
            Shubham Minglani Shubham Minglani
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: