feat: support context - #124
Open
tenstad wants to merge 2 commits into
Open
Conversation
Signed-off-by: Amund Tenstad <github@amund.io>
Signed-off-by: Amund Tenstad <github@amund.io>
jbw976
requested changes
Sep 8, 2026
jbw976
left a comment
Member
There was a problem hiding this comment.
thanks for taking the initiative to explore and push more on function-kro could support context. clearly there is some community demand for this feature, so thanks for stepping up!
i spent some time on this today because i really want to avoid any changes to KRO at all to support this.
Check out #30 (comment) and let me know what you think. If you like that direction, you can take first crack here at the implementation (absolutely feel free to use my agent prompt gist) and keep driving since you are showing the initiative here! 🙇♂️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
Adds support for use of context values in templated resources.
region: '${context["apiextensions.crossplane.io/environment"].region'Relates to #30
@jbw976 had some concerns regarding the feature in #30 (comment): We're actively trying to minimize divergence from upstream KRO. I'm not that familiar with CEL/KRO and unsure if this diverges beyond what is acceptable.
The suggestion requires the function input to describe the schema of the context. https://kro.run/api/specifications/simple-schema could make the process easier. Another option is to infer the schema from the contents of the context, but it's a bit tricky for lists of objects.
If going forward with this, we should think a bit ahead and concider how output to context could look as well, before we lock in the
contextfunction input spec.I have: