Skip to content

Commit de4e713

Browse files
update readme
Signed-off-by: Steven Borrelli <[email protected]>
1 parent d36f0f1 commit de4e713

File tree

3 files changed

+37
-13
lines changed

3 files changed

+37
-13
lines changed

README.md

+37-11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ of individual resources.
88

99
## Installing this Function
1010

11+
The function can be installed as a Crossplane package, and runs in a [Composition Function](https://docs.crossplane.io/latest/concepts/composition-functions/). This feature requires a minium Crossplane version of 1.14.
12+
1113
```yaml
1214
apiVersion: pkg.crossplane.io/v1beta1
1315
kind: Function
@@ -21,7 +23,9 @@ spec:
2123
2224
## What this function does
2325
24-
This function enables condition rendering of the entire function or select resources.
26+
This function enables conditional rendering of the entire function or select resources.
27+
28+
The language used for Conditionals is the [Common Expression Language (CEL)](https://github.com/google/cel-spec), which is widely used in the Kubernetes ecosystem.
2529
2630
### Conditionally Running the Function
2731
@@ -168,24 +172,46 @@ Produces the following output, showing what resources Crossplane would compose:
168172

169173
```yaml
170174
---
171-
apiVersion: example.crossplane.io/v1
172-
kind: XR
175+
apiVersion: nop.example.org/v1alpha1
176+
kind: XNopResource
173177
metadata:
174-
name: example-xr
178+
name: test-resource
175179
---
176-
apiVersion: s3.aws.upbound.io/v1beta1
177-
kind: Bucket
180+
apiVersion: nop.crossplane.io/v1alpha1
181+
kind: NopResource
178182
metadata:
179183
annotations:
180-
crossplane.io/composition-resource-name: bucket
181-
generateName: example-xr-
184+
crossplane.io/composition-resource-name: test-resource
185+
generateName: test-resource-
182186
labels:
183-
crossplane.io/composite: example-xr
187+
crossplane.io/composite: test-resource
184188
ownerReferences:
185-
# Omitted for brevity
189+
- apiVersion: nop.example.org/v1alpha1
190+
blockOwnerDeletion: true
191+
controller: true
192+
kind: XNopResource
193+
name: test-resource
194+
uid: ""
186195
spec:
187196
forProvider:
188-
region: us-east-2
197+
conditionAfter:
198+
- conditionStatus: "True"
199+
conditionType: Ready
200+
time: 5s
201+
connectionDetails:
202+
- name: username
203+
value: fakeuser
204+
- name: password
205+
value: verysecurepassword
206+
- name: endpoint
207+
value: 127.0.0.1
208+
fields:
209+
arrayField:
210+
- stringField: array
211+
integerField: 42
212+
objectField:
213+
stringField: object
214+
stringField: string
189215
```
190216

191217
See the [composition functions documentation][docs-functions] to learn how to

examples/conditional-rendering/functions.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ apiVersion: pkg.crossplane.io/v1beta1
22
kind: Function
33
metadata:
44
name: function-conditional-patch-and-transform
5-
annotations:
6-
render.crossplane.io/runtime: Development
75
spec:
86
package: xpkg.upbound.io/borrelli-org/function-conditional-patch-and-transform:v0.3.0
97
packagePullPolicy: Always
Binary file not shown.

0 commit comments

Comments
 (0)