-
Notifications
You must be signed in to change notification settings - Fork 17
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
Extra resources with matchName does not work #172
Comments
This is a strange question, and I'm not sure if the upstream community has encountered it before. I have confirmed that the logic in function-kcl is correct and the unit testing is passed. Perhaps it's a problem with the crossplane runtime. What is your crossplane version? |
I'm running Crossplane 1.17.1 in kubernetes 1.30 |
I see. Is it because the function-kcl version in the cluster is too low and does not support extraResources yet, which may result in different results from cross plane rendering? |
You were probably right about the wrong function-kcl version, nice catch! I made sure that version 0.10.1 is installed, and this is the current output showing the right version is now applied:
Now when I use this extra resources:
I get a different error:
|
@Peefy I've also added this simple reproducer for the issue: You can launch setup.sh and then: |
I've found the related issue: crossplane-contrib/function-extra-resources#27 @irizzant |
Hi @Peefy Does function-kcl use function-extra-resources under the hood? Since the matchLabels field allows for namespaced resources, shouldn't it be fixed? |
Errors seem emerge from the crossplane rather than in the function-kcl 🤔 |
Are you suggesting that in: there should be something like this? nn := types.NamespacedName{Name: rs.GetMatchName(), Namespace: "your-namespace"} |
Yes. Or we can try to input a cluster scoped resource. |
It doesn't look correct to me, given that you can specify a matchName one should be able to either specify a namespace or not to specify it at all |
I asked in Crossplane Slack. With extra resources you can only fetch composite (cluster scoped) resources. Here is the answer from one of the maintainer:
You can fetch these composite resources either via name or labels. If you would like to fetch a composite resource via the claim name you could use But this should be maybe clarified in the docs that extra resources is specific to composite (cluster scoped) resources and does not work with claims 👍 |
Ok thank you for the clarifications |
What happened?
I have the following Extra Resources defined
which matches the following project definition:
I then try to use this resource inside a Composition like this:
But the end result is that the test annotation is empty in my kubernetes cluster:
Instead, when I try to run
crossplane beta render
and specify the following manifest as extra resource:I get a different result and the annotation is loaded:
How can we reproduce it?
What environment did it happen in?
Function version: 0.10.1
The text was updated successfully, but these errors were encountered: