Documentation
¶
Index ¶
- func ExecuteTemplate(tmpl *template.Template, contextObj commonapi.DcpModelObject, input string, ...) (string, error)
- func IsTransientTemplateError(err error) bool
- func NewHealthProbeSpecValueTemplate(ctx context.Context, client ctrl_client.Client, ...) (*template.Template, error)
- func NewSpecValueTemplate(ctx context.Context, client ctrl_client.Client, ...) (*template.Template, error)
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 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.