-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcrane-transform.yaml
63 lines (60 loc) · 2.09 KB
/
crane-transform.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
name: crane-transform
annotations:
description: |
Take the resources from a `crane-export` and generate JSON patches to
remove cluster specific metadata and status information. If optional-flags
are defined, they will be passed to all enabled plugins.
spec:
params:
- name: optional-flags
type: string
description: |
Comma separated list of `flag-name=value` pairs. These flags with values
will be passed into all plugins that are executed in the transform
operation.
default: ""
steps:
- name: crane-transform
image: quay.io/konveyor/crane-runner:latest
script: |
set -e
set -o pipefail
set -x
if [ ! -z "${OPTIONAL_FLAG_VALUES}" ]; then
OPTIONAL_FLAGS="--optional-flags=${OPTIONAL_FLAG_VALUES}"
fi
crane transform \
--ignored-patches-dir="$(workspaces.ignored-patches.path)" \
--flags-file="$(workspaces.craneconfig.path)" \
--export-dir="$(workspaces.export.path)" \
--transform-dir=$(workspaces.transform.path) \
${OPTIONAL_FLAGS}
find $(workspaces.transform.path)
if [ "$(workspaces.ignored-patches.bound)" == "true" ]; then
find $(workspaces.ignored-patches.path)
fi
env:
- name: OPTIONAL_FLAG_VALUES
value: $(params.optional-flags)
workspaces:
- name: export
description: |
This is the folder where the results of crane export were stored.
mountPath: /var/crane/export
- name: transform
description: |
This is the folder where we will store the results of crane transform.
mountPath: /var/crane/transform
- name: ignored-patches
description: |
This is the folder where the results of crane ignored-patches were stored.
mountPath: /var/crane/ignored-patches
optional: true
- name: craneconfig
description: |
This is where we hold the configuration file for crane.
mountPath: /var/crane/config
optional: true