Struct ktmpl::Template[][src]

pub struct Template { /* fields omitted */ }
Expand description

A Kubernetes manifest template and the values for each of its parameters.

Implementations

Creates a new template.

Parameters

  • template_contents: The YAML template file’s contents.
  • parameter_values: A map of the template’s parameters and the user-supplied values for each.
  • secrets: A list of Kubernetes secrets whose data keys should be Base64 encoded after parameter interpolation.

Errors

Returns an error if:

  • There was more than one YAML document present in the template contents.
  • The YAML document did not contain an “objects” key or it was not an array value.
  • The YAML document did not contain a “parameters” key or it was not an array value.
  • One of the parameters doesn’t have a “name” key.
  • One of the parameters specifies an invalid “parameterType”.
  • One of the parameters requires a value which wasn’t supplied.
  • Any of the provided secrets were not found in the template.
  • There was an error in the structure of a secret that prevented its data from being Base64 encoded.

Interpolates the parameters’ values into the YAML template, returning the results.

Errors

Returns an error if the processed template was not valid YAML, or if any specified secrets could not be found and Base64 encoded.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.