crossplane-contrib / function-kcl

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

KCLInput vs KCLRun #98

Closed jgascon-nx closed 4 months ago

jgascon-nx commented 4 months ago

In the Crossplane Marketplace one can find the KCLInput.template.fn.crossplane.io/v1beta1 specification (here).

However, all the provided examples here use KCLRun.krm.kcl.dev/v1alpha1.

Both CRDs have not the same spec (For instance, you cannot set target: Default in KCLInput), so I was wondering:

Thanks!

Peefy commented 4 months ago

Hello, krm kcl is currently undergoing refactoring and can be seen as an integrated interface between the KCL ecosystem and Kubernetes ecosystem tools. It defines some general specifications, methods, and implementations, namely what input and output parameters are, and what fields are. Different tools can be extended or partially implemented based on this specification.

Additionally, the specification defined in krm kcl is not a deployable resource, it does not have a CRD, and you can simply consider it as a public component and API. The fields of KCLInput of crossplane function kcl will be set to KCLRun and get the result, and it is just like a k8s-like API for the KCL CLI.

Thank you for your feedback. I will supplement the complete documentation for this area in the future when the refactor is finished.

jgascon-nx commented 4 months ago

I see, thank you for the clarifications! 😃