You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While generating resources with KCL, I encountered an issue where creating resources with the same name (but of different types) resulted in the removal of duplicated names from the output. There were no errors during the process, making debugging quite difficult. I expected the function to return a complete list of resources, as the resource types were different despite having the same name.
I found an issue that describes pretty much the same problem. It was closed, but it seems the problem still persists: #91
I was bitten by this as well. It took quite a long time to diagnose.
function-kcl should return a clear error when this happens. It should not silently discard some of the resources or render what is left. "ON ERROR RESUME NEXT" is a terrible strategy.
What happened?
While generating resources with KCL, I encountered an issue where creating resources with the same name (but of different types) resulted in the removal of duplicated names from the output. There were no errors during the process, making debugging quite difficult. I expected the function to return a complete list of resources, as the resource types were different despite having the same name.
I found an issue that describes pretty much the same problem. It was closed, but it seems the problem still persists: #91
How can we reproduce it?
Go to https://github.com/crossplane-contrib/function-kcl/tree/main/examples/resources/network and modify
composition.yaml
to duplicate name:Output of
crossplane render xr.yaml composition.yaml functions.yaml -r
looks as follows:As you can see the VPC resource is missing.
What environment did it happen in?
Function version:
main
function-kcl
locally on my M1 macDarwin ASI-J4WN77WP43 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020 arm64
The text was updated successfully, but these errors were encountered: