Open sschne opened 1 month ago
Thanks for the feedback. At present, different resource names need to be set according to the following method.
Perhaps we can add necessary name checks to crossplane function-kcl, PRs welcome!
Ok i totally overlooked that one, sorry for that. A check would be good, i will try to come up with a PR. What i also noticed that the annotation only works for target "Default", but not for target "Resources", which should also be supported, right?
Yes, all targets should be supported, thank you very much for your contribution! ❤️
I ran into a similar issue yesterday. I was generating 2 resources, with different api/kind, but with same metadata.name
, the last one won.
# Resource One
apiVersion = "projects.gitlab.crossplane.io/v1alpha1"
kind = "Group"
metadata.name = "{}-{}".format(isv,cnf)
# Resource Two
apiVersion = "projects.gitlab.crossplane.io/v1alpha1"
kind = "Project"
metadata.name = "{}-{}".format(isv,cnf)
# Result: only the resource #2 would be generated.
Behavior wise, it would be good to have the granularity at the api/kind/name or at the very least warn the developer that a resource has been overwritten when rendering/testing.
What happened?
When having multiple desired resources with the same metadata.name or metadata.name is omitted, only the last resource will be returned from the function
How can we reproduce it?
Take e.g. examples/resources/network and remove metadata.name from both resources to be generated.
What environment did it happen in?
Function version: v0.9.0