-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skopeo-copy: add ability to pass parameters and copy manifests #1127
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @simbelmas. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Diff between version 0.2 and 0.3diff --git a/task/skopeo-copy/0.2/README.md b/task/skopeo-copy/0.3/README.md
index 46953a9..dfeee51 100644
--- a/task/skopeo-copy/0.2/README.md
+++ b/task/skopeo-copy/0.3/README.md
@@ -75,6 +75,12 @@ docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
docker://quay.io/temp/kubeconfigwriter:v2 docker://quay.io/skopeotest/kube:v2
```
+Each copy can be customized by adding *skopeo copy* parameters before images transport.
+
+```
+--all docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
+```
+
`ConfigMap` should be created using this file. Following `command` can be used to create configMap from the `file`.
```
kubectl create configmap image-configmap --from-file=url.txt
diff --git a/task/skopeo-copy/0.2/skopeo-copy.yaml b/task/skopeo-copy/0.3/skopeo-copy.yaml
index 978930a..d7d5865 100644
--- a/task/skopeo-copy/0.2/skopeo-copy.yaml
+++ b/task/skopeo-copy/0.3/skopeo-copy.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: skopeo-copy
labels:
- app.kubernetes.io/version: "0.2"
+ app.kubernetes.io/version: "0.3"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: CLI
@@ -45,22 +45,18 @@ spec:
- name: HOME
value: /tekton/home
image: quay.io/skopeo/stable:v1.9.0
+ imagePullPolicy: IfNotPresent
script: |
# Function to copy multiple images.
#
copyimages() {
filename="$(workspaces.images-url.path)/url.txt"
- while IFS= read -r line || [ -n "$line" ]
+ while read -r line || [ -n "$line" ]
do
- cmd=""
- for url in $line
- do
- # echo $url
- cmd="$cmd \
- $url"
- done
- skopeo copy "$cmd" --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
- echo "$cmd"
+ (
+ set +x
+ skopeo copy $line --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
+ )
done < "$filename"
}
# |
Catlin Output
Catlin script lint Output
|
Diff between version 0.2 and 0.3diff --git a/task/skopeo-copy/0.2/README.md b/task/skopeo-copy/0.3/README.md
index 46953a9..dfeee51 100644
--- a/task/skopeo-copy/0.2/README.md
+++ b/task/skopeo-copy/0.3/README.md
@@ -75,6 +75,12 @@ docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
docker://quay.io/temp/kubeconfigwriter:v2 docker://quay.io/skopeotest/kube:v2
```
+Each copy can be customized by adding *skopeo copy* parameters before images transport.
+
+```
+--all docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
+```
+
`ConfigMap` should be created using this file. Following `command` can be used to create configMap from the `file`.
```
kubectl create configmap image-configmap --from-file=url.txt
diff --git a/task/skopeo-copy/0.2/skopeo-copy.yaml b/task/skopeo-copy/0.3/skopeo-copy.yaml
index 978930a..681031c 100644
--- a/task/skopeo-copy/0.2/skopeo-copy.yaml
+++ b/task/skopeo-copy/0.3/skopeo-copy.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: skopeo-copy
labels:
- app.kubernetes.io/version: "0.2"
+ app.kubernetes.io/version: "0.3"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: CLI
@@ -45,22 +45,18 @@ spec:
- name: HOME
value: /tekton/home
image: quay.io/skopeo/stable:v1.9.0
+ imagePullPolicy: IfNotPresent
script: |
# Function to copy multiple images.
#
copyimages() {
filename="$(workspaces.images-url.path)/url.txt"
- while IFS= read -r line || [ -n "$line" ]
+ while read -r line || [ -n "$line" ]
do
- cmd=""
- for url in $line
- do
- # echo $url
- cmd="$cmd \
- $url"
- done
- skopeo copy "$cmd" --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
- echo "$cmd"
+ (
+ set -x
+ skopeo copy $line --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
+ )
done < "$filename"
}
# |
Catlin Output
Catlin script lint Output
|
/ok-to-test |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for reviewing this PR very late 😓
I have added a couple of minor comments, can you please take a look? Also can you please sign the CLA and also fix the linting issues?
/remove-lifecycle rotten |
i'm looking forwards to this. There is a current bug in the version 0.2 of this task where if u provide it with a |
Catlin Output
Catlin script lint Output
|
1 similar comment
Catlin Output
Catlin script lint Output
|
Co-authored-by: Vinamra Jain <[email protected]>
Co-authored-by: Vinamra Jain <[email protected]>
Co-authored-by: Vinamra Jain <[email protected]>
Co-authored-by: Vinamra Jain <[email protected]>
Catlin Output
Catlin script lint Output
|
Diff between version 0.2 and 0.3diff --git a/task/skopeo-copy/0.2/README.md b/task/skopeo-copy/0.3/README.md
index 46953a9..e222862 100644
--- a/task/skopeo-copy/0.2/README.md
+++ b/task/skopeo-copy/0.3/README.md
@@ -39,7 +39,7 @@ This `task` can be used to copy one or more than one images to-and fro various s
## Install the Task
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/0.2/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/0.3/raw
```
## Parameters
@@ -58,7 +58,7 @@ kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/
* `Secret` to provide the credentials of the source and destination registry where the image needs to be copied from and to.
* `ConfigMap` to provide support for copying multiple images, this contains file `url.txt` which stores images registry URL's.
- [This](../0.2/samples/quay-secret.yaml) example can help to use secrets for providing credentials of image registries.
+ [This](../0.3/samples/quay-secret.yaml) example can help to use secrets for providing credentials of image registries.
## Platforms
@@ -75,6 +75,12 @@ docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
docker://quay.io/temp/kubeconfigwriter:v2 docker://quay.io/skopeotest/kube:v2
```
+Each copy can be customized by adding *skopeo copy* parameters before images transport.
+
+```
+--all docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
+```
+
`ConfigMap` should be created using this file. Following `command` can be used to create configMap from the `file`.
```
kubectl create configmap image-configmap --from-file=url.txt
@@ -84,9 +90,9 @@ In case there is only one source and destination image that needs to be copied t
This will result in the image getting copied from the source registry to the destination registry.
-[This](../0.2/samples/serviceaccount.yaml) will guide the user to use service account for authorization to image registries.
+[This](../0.3/samples/serviceaccount.yaml) will guide the user to use service account for authorization to image registries.
-See [here](../0.2/samples/run.yaml) for example of `TaskRun`.
+See [here](../0.3/samples/run.yaml) for example of `TaskRun`.
### Note
- `Source credentials` are only required, if the source image registry needs authentication to pull the image, whereas `Destination credentials` are always required.
diff --git a/task/skopeo-copy/0.2/skopeo-copy.yaml b/task/skopeo-copy/0.3/skopeo-copy.yaml
index 978930a..681031c 100644
--- a/task/skopeo-copy/0.2/skopeo-copy.yaml
+++ b/task/skopeo-copy/0.3/skopeo-copy.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: skopeo-copy
labels:
- app.kubernetes.io/version: "0.2"
+ app.kubernetes.io/version: "0.3"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: CLI
@@ -45,22 +45,18 @@ spec:
- name: HOME
value: /tekton/home
image: quay.io/skopeo/stable:v1.9.0
+ imagePullPolicy: IfNotPresent
script: |
# Function to copy multiple images.
#
copyimages() {
filename="$(workspaces.images-url.path)/url.txt"
- while IFS= read -r line || [ -n "$line" ]
+ while read -r line || [ -n "$line" ]
do
- cmd=""
- for url in $line
- do
- # echo $url
- cmd="$cmd \
- $url"
- done
- skopeo copy "$cmd" --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
- echo "$cmd"
+ (
+ set -x
+ skopeo copy $line --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
+ )
done < "$filename"
}
# |
Catlin Output
Catlin script lint Output
|
Diff between version 0.2 and 0.3diff --git a/task/skopeo-copy/0.2/README.md b/task/skopeo-copy/0.3/README.md
index 46953a9..e222862 100644
--- a/task/skopeo-copy/0.2/README.md
+++ b/task/skopeo-copy/0.3/README.md
@@ -39,7 +39,7 @@ This `task` can be used to copy one or more than one images to-and fro various s
## Install the Task
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/0.2/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/0.3/raw
```
## Parameters
@@ -58,7 +58,7 @@ kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/
* `Secret` to provide the credentials of the source and destination registry where the image needs to be copied from and to.
* `ConfigMap` to provide support for copying multiple images, this contains file `url.txt` which stores images registry URL's.
- [This](../0.2/samples/quay-secret.yaml) example can help to use secrets for providing credentials of image registries.
+ [This](../0.3/samples/quay-secret.yaml) example can help to use secrets for providing credentials of image registries.
## Platforms
@@ -75,6 +75,12 @@ docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
docker://quay.io/temp/kubeconfigwriter:v2 docker://quay.io/skopeotest/kube:v2
```
+Each copy can be customized by adding *skopeo copy* parameters before images transport.
+
+```
+--all docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
+```
+
`ConfigMap` should be created using this file. Following `command` can be used to create configMap from the `file`.
```
kubectl create configmap image-configmap --from-file=url.txt
@@ -84,9 +90,9 @@ In case there is only one source and destination image that needs to be copied t
This will result in the image getting copied from the source registry to the destination registry.
-[This](../0.2/samples/serviceaccount.yaml) will guide the user to use service account for authorization to image registries.
+[This](../0.3/samples/serviceaccount.yaml) will guide the user to use service account for authorization to image registries.
-See [here](../0.2/samples/run.yaml) for example of `TaskRun`.
+See [here](../0.3/samples/run.yaml) for example of `TaskRun`.
### Note
- `Source credentials` are only required, if the source image registry needs authentication to pull the image, whereas `Destination credentials` are always required.
diff --git a/task/skopeo-copy/0.2/skopeo-copy.yaml b/task/skopeo-copy/0.3/skopeo-copy.yaml
index 978930a..681031c 100644
--- a/task/skopeo-copy/0.2/skopeo-copy.yaml
+++ b/task/skopeo-copy/0.3/skopeo-copy.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: skopeo-copy
labels:
- app.kubernetes.io/version: "0.2"
+ app.kubernetes.io/version: "0.3"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: CLI
@@ -45,22 +45,18 @@ spec:
- name: HOME
value: /tekton/home
image: quay.io/skopeo/stable:v1.9.0
+ imagePullPolicy: IfNotPresent
script: |
# Function to copy multiple images.
#
copyimages() {
filename="$(workspaces.images-url.path)/url.txt"
- while IFS= read -r line || [ -n "$line" ]
+ while read -r line || [ -n "$line" ]
do
- cmd=""
- for url in $line
- do
- # echo $url
- cmd="$cmd \
- $url"
- done
- skopeo copy "$cmd" --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
- echo "$cmd"
+ (
+ set -x
+ skopeo copy $line --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
+ )
done < "$filename"
}
# |
1 similar comment
Diff between version 0.2 and 0.3diff --git a/task/skopeo-copy/0.2/README.md b/task/skopeo-copy/0.3/README.md
index 46953a9..e222862 100644
--- a/task/skopeo-copy/0.2/README.md
+++ b/task/skopeo-copy/0.3/README.md
@@ -39,7 +39,7 @@ This `task` can be used to copy one or more than one images to-and fro various s
## Install the Task
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/0.2/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/0.3/raw
```
## Parameters
@@ -58,7 +58,7 @@ kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/
* `Secret` to provide the credentials of the source and destination registry where the image needs to be copied from and to.
* `ConfigMap` to provide support for copying multiple images, this contains file `url.txt` which stores images registry URL's.
- [This](../0.2/samples/quay-secret.yaml) example can help to use secrets for providing credentials of image registries.
+ [This](../0.3/samples/quay-secret.yaml) example can help to use secrets for providing credentials of image registries.
## Platforms
@@ -75,6 +75,12 @@ docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
docker://quay.io/temp/kubeconfigwriter:v2 docker://quay.io/skopeotest/kube:v2
```
+Each copy can be customized by adding *skopeo copy* parameters before images transport.
+
+```
+--all docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
+```
+
`ConfigMap` should be created using this file. Following `command` can be used to create configMap from the `file`.
```
kubectl create configmap image-configmap --from-file=url.txt
@@ -84,9 +90,9 @@ In case there is only one source and destination image that needs to be copied t
This will result in the image getting copied from the source registry to the destination registry.
-[This](../0.2/samples/serviceaccount.yaml) will guide the user to use service account for authorization to image registries.
+[This](../0.3/samples/serviceaccount.yaml) will guide the user to use service account for authorization to image registries.
-See [here](../0.2/samples/run.yaml) for example of `TaskRun`.
+See [here](../0.3/samples/run.yaml) for example of `TaskRun`.
### Note
- `Source credentials` are only required, if the source image registry needs authentication to pull the image, whereas `Destination credentials` are always required.
diff --git a/task/skopeo-copy/0.2/skopeo-copy.yaml b/task/skopeo-copy/0.3/skopeo-copy.yaml
index 978930a..681031c 100644
--- a/task/skopeo-copy/0.2/skopeo-copy.yaml
+++ b/task/skopeo-copy/0.3/skopeo-copy.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: skopeo-copy
labels:
- app.kubernetes.io/version: "0.2"
+ app.kubernetes.io/version: "0.3"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: CLI
@@ -45,22 +45,18 @@ spec:
- name: HOME
value: /tekton/home
image: quay.io/skopeo/stable:v1.9.0
+ imagePullPolicy: IfNotPresent
script: |
# Function to copy multiple images.
#
copyimages() {
filename="$(workspaces.images-url.path)/url.txt"
- while IFS= read -r line || [ -n "$line" ]
+ while read -r line || [ -n "$line" ]
do
- cmd=""
- for url in $line
- do
- # echo $url
- cmd="$cmd \
- $url"
- done
- skopeo copy "$cmd" --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
- echo "$cmd"
+ (
+ set -x
+ skopeo copy $line --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
+ )
done < "$filename"
}
# |
Catlin Output
Catlin script lint Output
|
Diff between version 0.2 and 0.3diff --git a/task/skopeo-copy/0.2/README.md b/task/skopeo-copy/0.3/README.md
index 46953a9..e222862 100644
--- a/task/skopeo-copy/0.2/README.md
+++ b/task/skopeo-copy/0.3/README.md
@@ -39,7 +39,7 @@ This `task` can be used to copy one or more than one images to-and fro various s
## Install the Task
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/0.2/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/0.3/raw
```
## Parameters
@@ -58,7 +58,7 @@ kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/skopeo-copy/
* `Secret` to provide the credentials of the source and destination registry where the image needs to be copied from and to.
* `ConfigMap` to provide support for copying multiple images, this contains file `url.txt` which stores images registry URL's.
- [This](../0.2/samples/quay-secret.yaml) example can help to use secrets for providing credentials of image registries.
+ [This](../0.3/samples/quay-secret.yaml) example can help to use secrets for providing credentials of image registries.
## Platforms
@@ -75,6 +75,12 @@ docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
docker://quay.io/temp/kubeconfigwriter:v2 docker://quay.io/skopeotest/kube:v2
```
+Each copy can be customized by adding *skopeo copy* parameters before images transport.
+
+```
+--all docker://quay.io/temp/kubeconfigwriter:v1 docker://quay.io/skopeotest/kube:v1
+```
+
`ConfigMap` should be created using this file. Following `command` can be used to create configMap from the `file`.
```
kubectl create configmap image-configmap --from-file=url.txt
@@ -84,9 +90,9 @@ In case there is only one source and destination image that needs to be copied t
This will result in the image getting copied from the source registry to the destination registry.
-[This](../0.2/samples/serviceaccount.yaml) will guide the user to use service account for authorization to image registries.
+[This](../0.3/samples/serviceaccount.yaml) will guide the user to use service account for authorization to image registries.
-See [here](../0.2/samples/run.yaml) for example of `TaskRun`.
+See [here](../0.3/samples/run.yaml) for example of `TaskRun`.
### Note
- `Source credentials` are only required, if the source image registry needs authentication to pull the image, whereas `Destination credentials` are always required.
diff --git a/task/skopeo-copy/0.2/skopeo-copy.yaml b/task/skopeo-copy/0.3/skopeo-copy.yaml
index 978930a..681031c 100644
--- a/task/skopeo-copy/0.2/skopeo-copy.yaml
+++ b/task/skopeo-copy/0.3/skopeo-copy.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: skopeo-copy
labels:
- app.kubernetes.io/version: "0.2"
+ app.kubernetes.io/version: "0.3"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: CLI
@@ -45,22 +45,18 @@ spec:
- name: HOME
value: /tekton/home
image: quay.io/skopeo/stable:v1.9.0
+ imagePullPolicy: IfNotPresent
script: |
# Function to copy multiple images.
#
copyimages() {
filename="$(workspaces.images-url.path)/url.txt"
- while IFS= read -r line || [ -n "$line" ]
+ while read -r line || [ -n "$line" ]
do
- cmd=""
- for url in $line
- do
- # echo $url
- cmd="$cmd \
- $url"
- done
- skopeo copy "$cmd" --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
- echo "$cmd"
+ (
+ set -x
+ skopeo copy $line --src-tls-verify="$(params.srcTLSverify)" --dest-tls-verify="$(params.destTLSverify)"
+ )
done < "$filename"
}
# |
Catlin Output
Catlin script lint Output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simbelmas thanks for addressing the comments. Can you please sign the CLA and also squash the commits into a single one?
@simbelmas: PR needs rebase. 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. |
Changes
Add ability to pass parameters to skopeo copy command.
This allows to copy full manifests.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
contains
/kind <type>
. Valid types are bug, cleanup, design, documentation,feature, flake, misc, question, tep
<kind>/<name>/<version>/name.yaml
README.md
at<kind>/<name>/<version>/README.md
metadata.labels
-app.kubernetes.io/version
the same as the<version>
of the resourcemetadata.annotations
tekton.dev/pipelines.minVersion
spec.description
follows the convention