-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcomposition.yaml
44 lines (43 loc) · 1.3 KB
/
composition.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
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: xnetworks.platform.acme.co
spec:
compositeTypeRef:
apiVersion: platform.acme.co/v1alpha1
kind: XNetwork
mode: Pipeline
pipeline:
- step: compose
functionRef:
name: crossplane-contrib-function-kcl
input:
apiVersion: krm.kcl.dev/v1alpha1
kind: KCLRun
metadata:
name: compose-network
spec:
target: Resources
params:
name: "input-instance"
source: |
oxr = option("params").oxr
items = [{
apiVersion: "nop.crossplane.io/v1alpha1"
kind: "NopResource"
metadata.name = oxr.metadata.name
spec.forProvider = {
conditionAfter = [{
conditionStatus: "True"
conditionType: "Ready"
time: "5s"
}]
fields = {
autoCreateSubnetworks: oxr.spec.parameters.autoCreateSubnetworks
routingMode: oxr.spec.parameters.routingMode
}
}
}]
- step: automatically-detect-ready-composed-resources
functionRef:
name: crossplane-contrib-function-auto-ready