Skip to content

Commit 7f3adb2

Browse files
update example
Signed-off-by: Steven Borrelli <[email protected]>
1 parent f7de703 commit 7f3adb2

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

example/context/README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,34 @@ status:
3131
fromEnv: e
3232
---
3333
apiVersion: render.crossplane.io/v1beta1
34-
kind: Context
3534
fields:
3635
apiextensions.crossplane.io/environment:
36+
apiVersion: internal.crossplane.io/v1alpha1
37+
array:
38+
- "1"
39+
- "2"
40+
complex:
41+
a: b
42+
c:
43+
d: e
44+
f: "1"
45+
kind: Environment
46+
nestedEnvUpdate:
47+
hello: world
48+
update: environment
49+
newkey:
50+
apiVersion: internal.crossplane.io/v1alpha1
51+
hello: world
3752
kind: Environment
53+
other-context-key:
3854
apiVersion: internal.crossplane.io/v1alpha1
3955
complex:
4056
a: b
4157
c:
4258
d: e
4359
f: "1"
60+
kind: Environment
61+
kind: Context
4462
```
4563

4664
## Debugging This Function

example/context/composition.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,18 @@ spec:
3232
apiVersion: meta.gotemplating.fn.crossplane.io/v1alpha1
3333
kind: Context
3434
data:
35+
# update existing EnvironmentConfig by using the "apiextensions.crossplane.io/environment" key
3536
"apiextensions.crossplane.io/environment":
3637
update: environment
3738
nestedEnvUpdate:
3839
hello: world
40+
array:
41+
- "1"
42+
- "2"
43+
# read existing context and move it to another key
3944
"other-context-key":
4045
complex: {{ index .context "apiextensions.crossplane.io/environment" "complex" | toYaml | nindent 6 }}
46+
# Create a new Context key and populate it with data
4147
newkey:
4248
hello: world
4349
---

example/context/xrd.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
apiVersion: apiextensions.crossplane.io/v1
3+
kind: CompositeResourceDefinition
4+
metadata:
5+
name: xrs.example.crossplane.io
6+
spec:
7+
group: example.crossplane.io
8+
names:
9+
kind: XR
10+
plural: xrs
11+
connectionSecretKeys:
12+
- test
13+
versions:
14+
- name: v1
15+
served: true
16+
referenceable: true
17+
schema:
18+
openAPIV3Schema:
19+
type: object
20+
properties:
21+
status:
22+
type: object
23+
properties:
24+
fromEnv:
25+
type: string

0 commit comments

Comments
 (0)