Skip to content
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

Support loading context when running crossplane beta render #4811

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

negz
Copy link
Member

@negz negz commented Oct 14, 2023

Description of your changes

Context can be loaded from either values, or files. Either way, the value must be JSON. This could be used to inject "the environment" for testing function-patch-and-transform once crossplane-contrib/function-patch-and-transform#17 is merged. It could also be useful for developing new Functions that read from the environment.

Examples:

$ crossplane beta render xr.yaml comp.yaml fns.yaml \
  --context-values=apiextensions.crossplane.io/environment='{"key": "value"}';other-key='"stringvalue"' \
  --context-files=apiextensions.crossplane.io/environment=env.json

Note that context values are not merged. If a key appears in both --context-files and --context-values, the latter wins. If a key appears multiple times in the same flag, the last appearance wins.

I have:

  • Read and followed Crossplane's contribution process.
  • Added or updated unit and E2E tests for my change.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, if necessary.
  • Opened a PR updating the docs, if necessary.

Context can be loaded from either values, or files. Either way, the
value must be JSON.

Signed-off-by: Nic Cope <nicc@rk0n.org>
@negz negz requested review from a team and turkenh as code owners October 14, 2023 00:54
@negz negz requested a review from MisterMX October 14, 2023 00:54
@negz negz changed the title Support loading context when running crossplane render Support loading context when running crossplane beta render Oct 14, 2023
Signed-off-by: Nic Cope <nicc@rk0n.org>
@phisco phisco merged commit f0c2036 into crossplane:master Oct 16, 2023
17 of 18 checks passed
@negz negz deleted the now-with-less-x branch October 16, 2023 20:09
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.

None yet

2 participants