File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
content/core-concepts/kcl Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -21,18 +21,24 @@ _metadata = lambda name: str -> any {
2121}
2222
2323# Read the desired state for the XR from the pipeline
24- dxr = option("params").dxr
25-
26- # Set some new status on the XR
27- dxr.status.someInformation = "cool-status"
24+ _dxr = option("params").dxr
2825
2926# Construct a bucket
3027bucket = v1beta1.Bucket {
3128 metadata : _metadata("my-bucket")
3229 spec.forProvider.region = option("oxr").spec.region
3330}
34- # Return the bucket and new status for the XR
35- items = [bucket, dxr]
31+
32+ # Update the dxr status immutably
33+ _dxr = {
34+ **dxr
35+ status : {
36+ someInformation : " cool-status"
37+ }
38+ }
39+
40+ # Return the bucket and updated status for the XR
41+ items = [bucket, _dxr]
3642```
3743
3844Make sure you've described the status fields you write to in your function in the XRD corresponding to the composition.
You can’t perform that action at this time.
0 commit comments