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

skopeo-copy task cannot copy multiple images at once

XMLWordPrintable

    • False
    • None
    • False
    • Fixed skopeo-copy task to support copying multiple images using url.txt file.
    • Bug Fix
    • Proposed

      Downstream tracker of the GH Issue.

      Description of problem:

      I am trying to use provided Tasks + cluster resolver instead of ClusterTasks and found one discrepancy between skopeo-copy ClusterTask and the newly-provided Task.
      We use skopeo-copy task to copy image under more than one destination image URLs, so we utilize images_url workspace and url.txt file on it. In the ClusterTask, parameter source image URL and destination image URL were optional, i.e. they had default value of an empty string, so if they were not filled, the task would use the url.txt file method. But in the new Task they have no default value. This means they have to be filled, at least with an empty string. This, however, means that the exported_or_fail() function:

      https://github.com/openshift-pipelines/task-containers/blob/9d12f07a4b4ebc129c79ce4d54fdda0bdd43b069/scripts/skopeo-common.sh#L19-L23

      in the common.sh script makes the task fail because it requires source and destination image urls to be non-empty. It checks using the -z test option:

      https://github.com/openshift-pipelines/task-containers/blob/9d12f07a4b4ebc129c79ce4d54fdda0bdd43b069/scripts/common.sh#L24

      On the other hand, if we fill in a non-empty string, the task will bypass the url.txt file.

       

      I think the fix would be to mark the source and destination parameters as optional by providing default value "" to them and by removing these params from the following call:

      https://github.com/openshift-pipelines/task-containers/blob/9d12f07a4b4ebc129c79ce4d54fdda0bdd43b069/scripts/skopeo-common.sh#L19-L23

      Support for the task was seemingly added by #83 but due to the mentioned issue it has probably never worked.{}

      Steps to Reproduce

      Try to provide empty Source & Destination image, the task will fail, making it unable to use the url.txt file to copy multiple images at once.

      Actual results:

      Multiple images cannot be copied at once.

      Expected results:

      Multiple images can be copied by providing a url.txt file.

      Reproducibility (Always/Intermittent/Only Once):

      Always.

      Acceptance criteria: 

      Multiple images can be copied at once.

      Definition of Done:

      Pull request with the fix and test is merged in the task-containers repository.

      Build Details:

      N/A

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

      N/A

              mmacik@redhat.com Marian Macik
              mmacik@redhat.com Marian Macik
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: