crossplane-contrib / function-kcl

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

How do you patch the XR status? #49

Closed empath-nirvana closed 6 months ago

empath-nirvana commented 6 months ago

I've got a pipeline that creates resources, but I need to bubble status back up to the XR.

Is there an example of how to accomplish basically an ToCompositeFieldPath patch back to the XR using this function or with some other function?

The patch and transform function needs to know the name of the resource and that's not really deterministic.

Peefy commented 6 months ago

The XR patching example is here: https://github.com/crossplane-contrib/function-kcl/tree/main/examples/xr/patching. You can path the status field like this PR: https://github.com/crossplane-contrib/function-kcl/pull/50

empath-nirvana commented 6 months ago

Thanks, that worked! Now my problem is that "ocds" doesn't have the status of existing objects and nothing in parameters does. Is there a way to get access to the status of an existing object? (which is to say -- if I make a queue in step one, how to i get the queue url to add it to the status?)

empath-nirvana commented 6 months ago

actually there's a bug, let me open a pr

Peefy commented 6 months ago

Thank you! @empath-nirvana PRs welcome!