catalog icon indicating copy to clipboard operation
catalog copied to clipboard

skopeo-copy task fails with error "Exactly two arguments expected".

Open dcommisso opened this issue 2 years ago • 9 comments

Expected Behavior

skopeo-copy task here properly works without errors

Actual Behavior

skopeo-copy task fails with error Exactly two arguments expected when using multiple source and destination image registries.

Steps to Reproduce the Problem

  1. Create a file named url.txt containing all the source and destination image registries URL seperated by a space. Each set of images should be written in the new line.
  2. Create a configmap using this file:
    kubectl create ConfigMap image-configmap --from-file=url.txt
    
  3. Create a TaskRun referring the configmap:
    apiVersion: tekton.dev/v1beta1
    kind: TaskRun
    metadata:
      name: skopeo-run
    spec:
      serviceAccountName: secret-service-account
      taskRef:
        name: skopeo-copy
      workspaces:
      - name: images-url
        configmap:
          name: image-configmap
    

Additional Info

The problem is the double quotes in "$cmd" here

The reason is that double quotes prevents word splitting and an argument enclosed in double quotes presents itself as a single word, even if it contains whitespace separators. Therefore skopeo gets just one argument and complains with the error message Exactly two arguments expected.

The solution is to remove the double quotes from $cmd parameter. I will open a PR to fix this.

dcommisso avatar Dec 15 '22 10:12 dcommisso

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar Mar 15 '23 10:03 tekton-robot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten with a justification. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

tekton-robot avatar Apr 14 '23 10:04 tekton-robot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen with a justification. Mark the issue as fresh with /remove-lifecycle rotten with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

tekton-robot avatar May 14 '23 11:05 tekton-robot

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen with a justification. Mark the issue as fresh with /remove-lifecycle rotten with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

tekton-robot avatar May 14 '23 11:05 tekton-robot

/reopen

piyush-garg avatar Jul 28 '23 10:07 piyush-garg

@piyush-garg: Reopened this issue.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

tekton-robot avatar Jul 28 '23 10:07 tekton-robot

/remove-lifecycle rotten

piyush-garg avatar Jul 28 '23 10:07 piyush-garg

/kind bug /assign @dcommisso

piyush-garg avatar Jul 28 '23 10:07 piyush-garg

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar Oct 26 '23 11:10 tekton-robot