Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
func Filter(objs []runtime.RawExtension, filters ...FilterFunc) []runtime.RawExtension
Filter filters the given objs to return only those matching the given filters (if any)
func LoadObjectsFromEmbedFS ¶
func LoadObjectsFromEmbedFS(efs *embed.FS, variables *Variables) ([]*unstructured.Unstructured, error)
LoadObjectsFromEmbedFS loads all the kubernetes objects from an embedded filesystem and returns a list of Unstructured objects that can be applied in the cluster. The function will return all the objects it finds starting from the root of the embedded filesystem.
Types ¶
type FilterFunc ¶
type FilterFunc func(runtime.RawExtension) bool
FilterFunc a function to retain an object or not
var ( // RetainNamespaces a func to retain only namespaces RetainNamespaces FilterFunc = func(obj runtime.RawExtension) bool { gvk := obj.Object.GetObjectKind().GroupVersionKind() return gvk.Kind == "Namespace" } // RetainAllButNamespaces a func to retain all but namespaces RetainAllButNamespaces FilterFunc = func(obj runtime.RawExtension) bool { gvk := obj.Object.GetObjectKind().GroupVersionKind() return gvk.Kind != "Namespace" } )
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor the tool that will process and apply a template with variables
func NewProcessor ¶
NewProcessor returns a new Processor
func (Processor) Process ¶
func (p Processor) Process(tmpl *templatev1.Template, values map[string]string, filters ...FilterFunc) ([]runtimeclient.Object, error)
Process processes the template (ie, replaces the variables with their actual values) and optionally filters the result to return a subset of the template objects