Documentation
¶
Overview ¶
Package render handles ${VAR}-style substitution and YAML document splitting for templates rendered by `seictl bench up`.
Substitution uses os.Expand and is fail-closed: any unresolved ${VAR} in a template returns CatTemplateRender so the engineer sees the gap rather than an empty-string-laundered manifest.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Indent ¶
Indent left-pads every line of body with prefix. Trailing whitespace and a single trailing newline are preserved as the input had them.
func Render ¶
Render substitutes ${VAR} occurrences in tmpl with values from vars. Errors with the deduplicated, sorted list of missing keys.
func SplitYAML ¶
SplitYAML returns each non-empty document from a multi-doc YAML stream. The split happens on YAML document boundaries (a `---` line at column zero), preserving each document's original formatting. Comment-only documents (e.g., a provenance preamble at the top of a file before the first `---`) are filtered out — they carry no manifest data and would fail downstream Kind/Name extraction.
Types ¶
type ManifestRef ¶
type ManifestRef struct {
Kind string `json:"kind"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Action string `json:"action"`
}
ManifestRef is the minimal manifest metadata bench up emits per rendered document.
func ExtractRef ¶
func ExtractRef(doc []byte) (ManifestRef, error)
ExtractRef pulls Kind / metadata.name / metadata.namespace from a rendered Kubernetes manifest. Action is filled in by the caller.