1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-22 06:02:51 +00:00

Update skopeo task for tls-verify flag param

This will fix skopeo tasks to have param for tls-verify flag
and update tests accordingly
This commit is contained in:
Piyush Garg 2020-07-16 17:42:20 +05:30 committed by tekton-robot
parent e166d30895
commit 7e3478f283
3 changed files with 15 additions and 3 deletions

View File

@ -48,6 +48,8 @@ kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/
- **srcImageURL**: The URL of the image to be copied to the `destination` registry. - **srcImageURL**: The URL of the image to be copied to the `destination` registry.
- **destImageURL**: The URL of the image where the image from `source` should be copied to. - **destImageURL**: The URL of the image where the image from `source` should be copied to.
- **srcTLSverify**: Verify the TLS on the src registry endpoint
- **destTLSverify**: Verify the TLS on the dest registry endpoint
## Workspace ## Workspace

View File

@ -29,6 +29,14 @@ spec:
description: URL of the image where the image from source should be copied to description: URL of the image where the image from source should be copied to
type: string type: string
default: "" default: ""
- name: srcTLSverify
description: Verify the TLS on the src registry endpoint
type: string
default: "true"
- name: destTLSverify
description: Verify the TLS on the dest registry endpoint
type: string
default: "true"
steps: steps:
- name: skopeo-copy - name: skopeo-copy
image: quay.io/vinamra2807/skopeo:latest image: quay.io/vinamra2807/skopeo:latest
@ -46,7 +54,7 @@ spec:
cmd="$cmd \ cmd="$cmd \
$url" $url"
done done
skopeo copy $cmd skopeo copy $cmd --src-tls-verify=$(params.srcTLSverify) --dest-tls-verify=$(params.destTLSverify)
echo $cmd echo $cmd
done < "$filename" done < "$filename"
} }
@ -54,7 +62,7 @@ spec:
# If single image is to be copied then, it can be passed through # If single image is to be copied then, it can be passed through
# params in the taskrun. # params in the taskrun.
if [ "$(params.srcImageURL)" != "" ] && [ "$(params.destImageURL)" != "" ] ; then if [ "$(params.srcImageURL)" != "" ] && [ "$(params.destImageURL)" != "" ] ; then
skopeo copy "$(params.srcImageURL)" "$(params.destImageURL)" skopeo copy "$(params.srcImageURL)" "$(params.destImageURL)" --src-tls-verify=$(params.srcTLSverify) --dest-tls-verify=$(params.destTLSverify)
else else
# If file is provided as a configmap in the workspace then multiple images can be copied. # If file is provided as a configmap in the workspace then multiple images can be copied.
# #

View File

@ -7,7 +7,9 @@ spec:
- name: srcImageURL - name: srcImageURL
value: docker://quay.io/temp/kubeconfigwriter:v1 value: docker://quay.io/temp/kubeconfigwriter:v1
- name: destImageURL - name: destImageURL
value: localhost:5000/kube:latest value: docker://localhost:5000/kube:latest
- name: destTLSverify
value: "false"
taskRef: taskRef:
name: skopeo-copy name: skopeo-copy
workspaces: workspaces: