Skip to content

feat: support context - #124

Open
tenstad wants to merge 2 commits into
crossplane-contrib:mainfrom
tenstad:context
Open

feat: support context#124
tenstad wants to merge 2 commits into
crossplane-contrib:mainfrom
tenstad:context

Conversation

@tenstad

@tenstad tenstad commented Sep 3, 2026

Copy link
Copy Markdown

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 context function input spec.

I have:

Signed-off-by: Amund Tenstad <github@amund.io>
Signed-off-by: Amund Tenstad <github@amund.io>

@jbw976 jbw976 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! 🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants