templating

package
v0.22.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteTemplate

func ExecuteTemplate(
	tmpl *template.Template,
	contextObj commonapi.DcpModelObject,
	input string,
	substitutionContext string,
	log logr.Logger,
) (string, error)

Executes a template with the given input and substitution context (contextObj parameter). The 'substitutionContext' parameter provides additional information for logging if an issue occurs (e.g. "environment variable 'FOO' of object 'my-executable'").

func IsTransientTemplateError

func IsTransientTemplateError(err error) bool

func NewHealthProbeSpecValueTemplate

func NewHealthProbeSpecValueTemplate(
	ctx context.Context,
	client ctrl_client.Client,
	contextObj commonapi.DcpModelObject,
	log logr.Logger,
) (*template.Template, error)

Create a template for evaluating a value of a health probe belonging to a Container or Executable.

func NewSpecValueTemplate

func NewSpecValueTemplate(
	ctx context.Context,
	client ctrl_client.Client,
	contextObj commonapi.DcpModelObject,
	reservedPorts map[types.NamespacedName]int32,
	log logr.Logger,
) (*template.Template, error)

Creates a template for evaluating a value of a spec field of a Container or Executable. Our template functions may need to query the API server, this is what ctx and client parameters are for. The contextObject parameter is the object that will be used as context during template evaluation (Executable, Container, etc.) If a port needs to be reserved for a service production by the context object, information about the reserved port will be added to reservedPorts map (currently only used for Executables).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL