-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
How to reference Files with Starlark Function? #4182
Comments
@kferrone: This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
To the best of my knowledge, Starlark intentionally cannot do filesystem IO as a feature of the language (not specific to Kustomize). If you're unable to encode the input data into the function config itself, then I suggest you switch to a container function (which supports specified mounts) or an exec function (which has filesystem access inherently). Please note that we have an open KEP with a proposal for moving plugins in general forward from alpha, and it includes deprecating dedicated starlark support: kubernetes/enhancements#2954. Although Starlark has its advantages, it is a problem for us to maintain and notably causes a permanent inconsistency with kubectl kustomize due to the dependencies it requires. If you feel strongly about it, please comment on the KEP. Assuming the deprecation plan moves forward, we will not be adding features to Kustomize's Starlark function support. /unassign |
I figured it didn't. I wrote normal plugin with python instead. Starlark was an interesting idea, not worried about it at all. |
How do I reference a
functionFiles
from within a Starlark function?Here is the yaml for my function:
embed.yaml
Is it even possible for Starlark to reference files from the host? I have a feeling kustomize would have to read files and pass in the content as variables.
Within the code I can only get the name of the files in an array like so:
Now how to actually read the file contents?
The text was updated successfully, but these errors were encountered: