...

Package runfn

import "sigs.k8s.io/kustomize/kyaml/runfn"
Overview
Index

Overview ▾

Index ▾

Package files

runfn.go

type RunFns

RunFns runs the set of configuration functions in a local directory against the Resources in that directory

type RunFns struct {
    StorageMounts []runtimeutil.StorageMount

    // Path is the path to the directory containing functions
    Path string

    // FunctionPaths Paths allows functions to be specified outside the configuration
    // directory.
    // Functions provided on FunctionPaths are globally scoped.
    // If FunctionPaths length is > 0, then NoFunctionsFromInput defaults to true
    FunctionPaths []string

    // Functions is an explicit list of functions to run against the input.
    // Functions provided on Functions are globally scoped.
    // If Functions length is > 0, then NoFunctionsFromInput defaults to true
    Functions []*yaml.RNode

    // GlobalScope if true, functions read from input will be scoped globally rather
    // than only to Resources under their subdirs.
    GlobalScope bool

    // 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

    // NoFunctionsFromInput if set to true will not read any functions from the input,
    // and only use explicit sources
    NoFunctionsFromInput *bool

    // EnableStarlark will enable functions run as starlark scripts
    EnableStarlark bool

    // EnableExec will enable exec functions
    EnableExec bool

    // DisableContainers will disable functions run as containers
    DisableContainers bool

    // ResultsDir is where to write each functions results
    ResultsDir string

    // LogSteps enables logging the function that is running.
    LogSteps bool

    // LogWriter can be set to write the logs to LogWriter rather than stderr if LogSteps is enabled.
    LogWriter io.Writer

    // 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

    // WorkingDir specifies which working directory an exec function should run in.
    WorkingDir string
    // contains filtered or unexported fields
}

func (RunFns) Execute

func (r RunFns) Execute() error

Execute runs the command