-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Name conflict for resources of Different Kinds #241
Name conflict for resources of Different Kinds #241
Comments
Thanks for the quick response! I wish an error was returned when multiple resources had the same name. |
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. |
I started working on a patch to fix this then found that such error checking code had been removed in #132. That PR mentioned "the kcl issues" without any reference to what those issues might have been. Further archeology suggests a possible relation to #125, but #126 closed that issue so maybe not. So then the questions would be what precisely are the issues that led to #132 and what would be needed in order to revert that removal? Do we have a test case? |
Hello @johngmyers you can open a PR to fix this issue, the KCL issue mentioned in the previous issue should have been resolved. |
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: