crossplane-contrib / function-kcl

Crossplane Composition Functions using KCL Programming Language
Apache License 2.0
36 stars 16 forks source link

Write to Composite Resource #84

Closed vfarcic closed 5 months ago

vfarcic commented 5 months ago

What problem are you facing?

I don't see the option to write back to the Composite resource. According to https://github.com/crossplane-contrib/function-kcl?tab=readme-ov-file#guides-for-developing-kcl option can be used only to read, not to write.

How could this Function help solve your problem?

Add a feature equivalent to the ToCompositeFieldPath Patch and Transform type. An example:

    - type: ToCompositeFieldPath
      fromFieldPath: spec.forProvider.manifest.spec.rules[0].host
      toFieldPath: status.host 
Peefy commented 5 months ago

@vfarcic Sorry, I haven't updated the document yet. The current version of function-kcl already supports the status field of patch XR. You can refer to the example here to patch XR and put it into the items field to return it as a whole.

vfarcic commented 5 months ago

Thanks a ton.