Documentation ¶
Overview ¶
Package options provides functionality for adding options to components.
Options, in this context, are values that need to be added to components at runtime. Sometimes these are called 'last-mile' customizations. For example, you might want the Cluster IP or the Cluster Name to a specific value.
The parent options package provides common functionality and types while the subdirectories provide specific option-applying instances.
Index ¶
Constants ¶
const ( // MissingKeyError is an option for go templates. Execution stops immediately // with an error. This is the used as the default in the ClusterBundle. MissingKeyError = "missingkey=error" // MissingKeyDefault is same as MissingKeyInvalid. MissingKeyDefault = "missingkey=default" // MissingKeyInvalid ihe default behavior: Do nothing and continue execution. // If printed, the result of the index operation is the string MissingKeyInvalid = "missingkey=invalid" // MissingKeyZero is an option for go templates. The operation returns the // zero value for the map type's element. MissingKeyZero = "missingkey=zero" )
Variables ¶
This section is empty.
Functions ¶
func ApplyCommon ¶
func ApplyCommon(ref bundle.ComponentReference, objs []*unstructured.Unstructured, opts JSONOptions, objFn ObjHandler) ([]*unstructured.Unstructured, error)
ApplyCommon provides common functionality for applying options, deferring the specific object handling logic. The objects will be modified in-place; the caller should copy them if needed.
Types ¶
type Applier ¶
type Applier interface { // ApplyOptions applys options to some subset objects from the component. The // returned component should be copy of the original, with (perhaps) modifications made to the original. ApplyOptions(comp *bundle.Component, opts JSONOptions) (*bundle.Component, error) }
Applier represents an object that can take options and apply them to components.
type JSONOptions ¶
type JSONOptions map[string]interface{}
JSONOptions is an instance of options, represented as a JSON object encoded as map[string]interface{}. See more at the go docs for `encoding/json`.
type ObjHandler ¶
type ObjHandler func(obj *unstructured.Unstructured, ref bundle.ComponentReference, opts JSONOptions) (*unstructured.Unstructured, error)
ObjHandler is a function that can apply options to a Kubernetes object.
Directories ¶
Path | Synopsis |
---|---|
Package openapi provides methods for using the OpenAPI schema for validation and defaulting.
|
Package openapi provides methods for using the OpenAPI schema for validation and defaulting. |
Package rawtexttmpl is a special-case option applier for adding options to objects with the assumption that objects have been inlined as go-templates via RawTextFiles ComponentSpec field into ConfigMaps.
|
Package rawtexttmpl is a special-case option applier for adding options to objects with the assumption that objects have been inlined as go-templates via RawTextFiles ComponentSpec field into ConfigMaps. |
Package simpletemplate contains helpers for applying options with the assumption that cluster objects are simple go templates.
|
Package simpletemplate contains helpers for applying options with the assumption that cluster objects are simple go templates. |