Documentation
¶
Overview ¶
Package runneroptions holds options for the function runtime
Index ¶
Constants ¶
View Source
const ( FuncGenPkgContext = "builtins/gen-pkg-context" GHCRImagePrefix = "ghcr.io/kptdev/krm-functions-catalog/" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImagePullPolicy ¶
type ImagePullPolicy string
const ( AlwaysPull ImagePullPolicy = "Always" IfNotPresentPull ImagePullPolicy = "IfNotPresent" NeverPull ImagePullPolicy = "Never" )
func (*ImagePullPolicy) AllStrings ¶
func (e *ImagePullPolicy) AllStrings() []string
func (*ImagePullPolicy) HelpAllowedValues ¶
func (e *ImagePullPolicy) HelpAllowedValues() string
HelpAllowedValues builds help text for the allowed values
func (*ImagePullPolicy) Set ¶
func (e *ImagePullPolicy) Set(v string) error
Set implements pflag.Value
func (*ImagePullPolicy) String ¶
func (e *ImagePullPolicy) String() string
String implements pflag.Value and fmt.Stringer
type ImageResolveFunc ¶
ImageResolveFunc is the type for a function that can resolve a partial image to a (more) fully-qualified name
type RunnerOptions ¶
type RunnerOptions struct {
// ImagePullPolicy controls the image pulling behavior before running the container.
ImagePullPolicy ImagePullPolicy
// when set to true, function runner will set the package path annotation
// on resources that do not have it set. The resources generated by
// functions do not have this annotation set.
SetPkgPathAnnotation bool
DisplayResourceCount bool
// allowExec determines if function binary executable are allowed
// to be run during pipeline execution. Running function binaries is a
// privileged operation, so explicit permission is required.
AllowExec bool
// AllowNetwork specifies if container based functions are allowed
// to access network during pipeline execution. Accessing network is
// considered a privileged operation (and makes render operation non-hermetic),
// so explicit permission is desired.
AllowNetwork bool
// allowWasm determines if function wasm are allowed to be run during pipeline
// execution. Running wasm function is an alpha feature, so it needs to be
// enabled explicitly.
AllowWasm bool
// ResolveToImage will resolve a partial image to a fully-qualified one
ResolveToImage ImageResolveFunc
}
func (*RunnerOptions) InitDefaults ¶
func (opts *RunnerOptions) InitDefaults(defaultImagePrefix string)
func (*RunnerOptions) ResolveToImageForCLIFunc ¶
func (opts *RunnerOptions) ResolveToImageForCLIFunc(prefix string) func(_ context.Context, image string) (string, error)
ResolveToImageForCLIFunc returns a func that converts the KRM function short path to the full image url. If the function is a catalog function, it prepends `prefix`, e.g. "set-namespace:v0.1" --> prefix + "set-namespace:v0.1". A "/" is appended to `prefix` if it is not an empty string and does not end with a "/".
type SingleLineFormatter ¶
type SingleLineFormatter struct {
Title string // Label for the output
Lines []string // Lines to be joined
UseQuote bool // Whether to quote each line
Separator string // Separator between lines (e.g., comma, space)
}
func (*SingleLineFormatter) String ¶
func (sf *SingleLineFormatter) String() string
Click to show internal directories.
Click to hide internal directories.