Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToYaml ¶ added in v0.11.0
ToYaml takes any value, and returns its YAML representation as a string.
func YamlToObject ¶
YamlToObject parses a list of runtime.Objects from the provided yaml If the type is not known in the scheme, it tries to parse it as Unstructured We used to use 'apimachiner/pkg/util/yaml' for splitting the input into multiple yamls, however under the covers it uses bufio.NewScanner with token defaults with no option to modify. see: https://github.com/kubernetes/apimachinery/blob/release-1.6/pkg/util/yaml/decoder.go#L94 The YAML input can be too large for the default scan token size used by these packages. For more detail read: https://github.com/kudobuilder/kudo/pull/1400 TODO(av) could we use something else than a global scheme here? Should we somehow inject it?
Types ¶
type DefaultEnhancer ¶ added in v0.10.0
type DefaultEnhancer struct { Scheme *runtime.Scheme Discovery discovery.CachedDiscoveryInterface }
DefaultEnhancer is implementation of Enhancer that applies the defined conventions by directly editing runtime.Objects (Unstructured).
func (*DefaultEnhancer) Apply ¶ added in v0.10.0
func (de *DefaultEnhancer) Apply(templates map[string]string, metadata Metadata) (objsToAdd []runtime.Object, err error)
Apply accepts templates to be rendered in kubernetes and enhances them with our own KUDO conventions These include the way we name our objects and what labels we apply to them
type Engine ¶
Engine is the control struct for parsing and templating Kubernetes resources in an ordered fashion
func New ¶
func New() *Engine
New creates an engine with a default function map, using a modified Sprig func map. Because these templates are rendered by the operator, we delete any functions that potentially access the environment the controller is running in.
type Enhancer ¶
type Enhancer interface {
Apply(templates map[string]string, metadata Metadata) ([]runtime.Object, error)
}
Enhancer takes your kubernetes template and kudo related Metadata and applies them to all resources in form of labels and annotations it also takes care of setting an owner of all the resources to the provided object