Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EvalFnRunner ¶
type EvalFnRunner struct {
Command *cobra.Command
Dest string
OutContent bytes.Buffer
FromStdin bool
Image string
Tag string
SaveFn bool
FnType string
Exec string
FnConfigPath string
ResultsDir string
Network bool
Mounts []string
Env []string
AsCurrentUser bool
IncludeMetaResources bool
Ctx context.Context
Selector kptfilev1.Selector
Exclusion kptfilev1.Selector
RunnerOptions runneroptions.RunnerOptions
CelCondition string
// contains filtered or unexported fields
}
EvalFnRunner contains the run function
func GetEvalFnRunner ¶
func GetEvalFnRunner(ctx context.Context, parent string) *EvalFnRunner
GetEvalFnRunner returns a EvalFnRunner.
func (*EvalFnRunner) InitDefaults ¶
func (r *EvalFnRunner) InitDefaults()
func (*EvalFnRunner) NewFunction ¶
func (r *EvalFnRunner) NewFunction() *kptfilev1.Function
NewFunction creates a Kptfile.Function object which has the evaluated fn configurations. This object can be written to Kptfile `pipeline.mutators`.
func (*EvalFnRunner) SaveFnToKptfile ¶
func (r *EvalFnRunner) SaveFnToKptfile()
SaveFnToKptfile adds the evaluated function and its arguments to Kptfile `pipeline.mutators` or `pipeline.validators` .
type RunFns ¶
type RunFns struct {
Ctx context.Context
StorageMounts []runtimeutil.StorageMount
// Path is the path to the directory containing functions
Path string
// FnConfigPath specifies a config file which contains the configs used in
// function input. It can be absolute or relative to kpt working directory.
// The exact format depends on the OS.
FnConfigPath string
// Function is an function to run against the input.
Function *runtimeutil.FunctionSpec
// FnConfig is the configurations passed from command line
FnConfig *yaml.RNode
// Input can be set to read the Resources from Input rather than from a directory
Input io.Reader
// Network enables network access for functions that declare it
Network bool
// Output can be set to write the result to Output rather than back to the directory
Output io.Writer
// ResultsDir is where to write each functions results
ResultsDir string
// AsCurrentUser is a boolean to indicate whether docker container should use
// the uid and gid that run the command
AsCurrentUser bool
// Env contains environment variables that will be exported to container
Env []string
// ContinueOnEmptyResult configures what happens when the underlying pipeline
// returns an empty result.
// If it is false (default), subsequent functions will be skipped and the
// result will be returned immediately.
// If it is true, the empty result will be provided as input to the next
// function in the list.
ContinueOnEmptyResult bool
RunnerOptions runneroptions.RunnerOptions
// ExecArgs are the arguments for exec commands
ExecArgs []string
// OriginalExec is the original exec commands
OriginalExec string
Selector kptfilev1.Selector
Exclusion kptfilev1.Selector
CelCondition string
// contains filtered or unexported fields
}
RunFns runs the set of configuration functions in a local directory against the Resources in that directory