generated from crossplane/function-template-go
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathcomposition.yaml
35 lines (33 loc) · 1.08 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
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: example-function-get-composite-resource
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: |
---
# Use a getCompositeResource to retrieve the XR
{{ $xr := getCompositeResource . }}
apiVersion: dbforpostgresql.azure.upbound.io/v1beta1
kind: FlexibleServer
metadata:
annotations:
{{ setResourceNameAnnotation "flexserver" }}
gotemplating.fn.crossplane.io/ready: "False"
spec:
forProvider:
# Use the XR object to set values
adminLogin: {{ get $xr.spec "adminLogin" }}
location: {{ get $xr.spec "location" }}