Allow functions to enable the starlark filter (off by default)

This commit is contained in:
Phillip Wittrock
2020-03-24 20:12:39 -07:00
parent 85e9779bd6
commit 7164e55831
7 changed files with 215 additions and 37 deletions

View File

@@ -25,6 +25,9 @@ type FunctionSpec struct {
// Container is the spec for running a function as a container
Container ContainerSpec `json:"container,omitempty" yaml:"container,omitempty"`
// Starlark is the spec for running a function as a starlark script
Starlark StarlarkSpec `json:"starlark,omitempty" yaml:"starlark,omitempty"`
}
// ContainerSpec defines a spec for running a function as a container
@@ -42,6 +45,14 @@ type ContainerNetwork struct {
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
}
// StarlarkSpec defines how to run a function as a starlark program
type StarlarkSpec struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
// Path specifies a path to a starlark script
Path string `json:"path,omitempty" yaml:"path,omitempty"`
}
// GetFunctionSpec returns the FunctionSpec for a resource. Returns
// nil if the resource does not have a FunctionSpec.
//