Documentation
¶
Index ¶
- func BuiltInCustomFunctions(c *templateRenderWrapper, component *component.SynthesizedComponent, ...) *gotemplate.BuiltInObjectsFunc
- func RenderTemplate(resourceCtx *ResourceCtx, cluster *appsv1.Cluster, ...) ([]*corev1.ConfigMap, error)
- type ReconcileCtx
- type RenderedValidator
- type ResourceCtx
- type ResourceDefinition
- type TemplateRender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltInCustomFunctions ¶
func BuiltInCustomFunctions(c *templateRenderWrapper, component *component.SynthesizedComponent, localObjs []client.Object) *gotemplate.BuiltInObjectsFunc
BuiltInCustomFunctions builds a map of customized functions for KubeBlocks
func RenderTemplate ¶
func RenderTemplate(resourceCtx *ResourceCtx, cluster *appsv1.Cluster, synthesizedComponent *component.SynthesizedComponent, comp *appsv1.Component, localObjs []client.Object, tpls []appsv1.ComponentTemplateSpec) ([]*corev1.ConfigMap, error)
RenderTemplate renders multiple component templates into Kubernetes ConfigMap objects.
Parameters: - resourceCtx: The context for resource operations. - cluster: The cluster being reconciled. - synthesizedComponent: Details of the synthesized component. - comp: The component being reconciled. - localObjs: A cache of client objects. - tpls: A list of component template specifications.
Returns: - A slice of pointers to the rendered ConfigMap objects. - An error if the rendering or validation fails.
Types ¶
type ReconcileCtx ¶
type RenderedValidator ¶
type ResourceCtx ¶
type ResourceDefinition ¶
type TemplateRender ¶
type TemplateRender interface {
// RenderConfigMapTemplate renders a ConfigMap template based on the provided specification.
//
// Parameters:
// - templateSpec: The specification for the component template.
//
// Returns:
// - A map containing the rendered template data.
// - An error if the rendering fails.
RenderConfigMapTemplate(templateSpec appsv1.ComponentTemplateSpec) (map[string]string, error)
// RenderComponentTemplate renders a component template and validates the rendered data.
//
// Parameters:
// - templateSpec: The specification for the component template.
// - cmName: The name of the ConfigMap.
// - dataValidator: A function to validate the rendered data.
//
// Returns:
// - A pointer to the rendered ConfigMap.
// - An error if the rendering or validation fails.
RenderComponentTemplate(templateSpec appsv1.ComponentTemplateSpec,
cmName string,
dataValidator RenderedValidator) (*corev1.ConfigMap, error)
}
func NewTemplateBuilder ¶
func NewTemplateBuilder(reconcileCtx *ReconcileCtx) TemplateRender
Click to show internal directories.
Click to hide internal directories.