Allow Starlark source to be defined in Kptfile #2575
Labels
area/fn-catalog
Functions Catalog
enhancement
New feature or request
triaged
Issue has been triaged by adding an `area/` label
Describe your problem
functionConfig currently supports 2 approaches:
While these 2 approaches provide some flexibility in testing, it also creates inequality for certain functions, more specifically Starlark.
Example
Taking the core example of Starlark Configmap
When running this, a few options are available:
kpt fn eval --image gcr.io/kpt-fn/starlark:v0.3 --fn-config fn-set-replicas.yaml
kpt fn render
But a 3rd option exists, which is to extract the Starlark code into a much more user-friendly (and editor parsable) file:
Then run it via:
kpt fn eval --image gcr.io/kpt-fn/starlark:v0.3 -- source="$(cat set-replicas.star)" replicas=5
The problem is that you cannot then bring this back into your
Kptfile
, forcing you to copy this back into your awkward yaml file.Solution
Add support for Starlark file parsing, from a Kptfile. Similar to the
configPath
orconfigMap
option, add asourcePath
option where a.star
file path could be declared.Which would result in something like:
The text was updated successfully, but these errors were encountered: