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

Allow a default source to be configured via environment variable #196

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

adamwg
Copy link
Contributor

@adamwg adamwg commented Nov 19, 2024

Description of your changes

Enable function-kcl to be used as a base image for custom functions built in KCL by allowing the function input to be empty when a default source is set via environment variable. A user can build a custom function on top of function-kcl by including a directory containing a KCL module and setting the environment variable FUNCTION_KCL_DEFAULT_SOURCE to the module's path.

I have:

  • Read and followed Crossplane's [contribution process].
  • Added or updated unit tests for my change.

Enable function-kcl to be used as a base image for custom functions built in KCL
by allowing the function input to be empty when a default source is set via
environment variable. A user can build a custom function on top of function-kcl
by including a directory containing a KCL module and setting the environment
variable `FUNCTION_KCL_DEFAULT_SOURCE` to the module's path.

Signed-off-by: Adam Wolfe Gordon <awg@upbound.io>
@@ -21,6 +22,8 @@ import (
"sigs.k8s.io/yaml"
)

var defaultSource = os.Getenv("FUNCTION_KCL_DEFAULT_SOURCE")
Copy link
Collaborator

@Peefy Peefy Nov 20, 2024

Choose a reason for hiding this comment

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

Would you be willing to explain this usage method in the README document in another PR? Thank you! 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good idea. Done in #197.

@Peefy
Copy link
Collaborator

Peefy commented Nov 20, 2024

Would you be willing to explain this usage method in the README document in another PR? I will merge this PR. Thank you! 😄

Copy link
Collaborator

@Peefy Peefy left a comment

Choose a reason for hiding this comment

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

LGTM

@Peefy Peefy merged commit 39a276e into crossplane-contrib:main Nov 20, 2024
7 checks passed
adamwg added a commit to adamwg/function-kcl that referenced this pull request Nov 20, 2024
Follow-up for crossplane-contrib#196

Signed-off-by: Adam Wolfe Gordon <awg@upbound.io>
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