generated from crossplane/function-template-go
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathcomposition-wrapper.yaml
31 lines (31 loc) · 1001 Bytes
/
composition-wrapper.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
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: example-recursive-wrapper # defining the wrapper composition
spec:
compositeTypeRef:
apiVersion: example.crossplane.io/v1beta1
kind: XR
mode: Pipeline
pipeline:
- step: render-templates
functionRef:
name: function-go-templating
input:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
kind: GoTemplate
source: Inline
inline:
template: |
{{- range $i := until ( .observed.composite.resource.spec.count | int ) }}
---
apiVersion: example.crossplane.io/v1beta1
kind: XR
metadata:
annotations:
{{ setResourceNameAnnotation (print "test-xr-" $i) }}
spec:
compositionRef:
name: example-recursive-real # instantiating the real composition
region: {{ print "us-west-" (add $i 1) }}
{{ end }}