Documentation
¶
Overview ¶
Package render runs `helm template` over a packaged chart and returns the objects of the render, for a chart check written in Go: one that compares what a chart renders with a Go constant, which a pattern in a BUILD file cannot do (//bazel/helm/meshnames).
Nothing here prints a render: with default values the aether chart generates the webhook's private key at render time (#1382). When helm fails, only its exit status is returned: nothing it wrote, on either stream. Helm can put manifest text on stderr (a YAML parse error quotes the document), and the pattern rules pass it through a fail-closed mask for that reason (render_lib.sh, show_helm_failure). This package has no mask, so it shows none of it. A document that does not parse is reported without its text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Helm ¶
Helm is the toolchain's helm: the binary and its plugins directory.
func (Helm) Template ¶
Template runs `helm template release-name <chart> <opts>` and returns the objects of the render, in the order helm printed them. scratch is a directory helm may write to: it keeps its caches, repository list and registry credentials under $HOME, and a sandbox has no writable home.
type Meta ¶
type Meta struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
}
Meta is the part of an object's (or a pod template's) metadata a chart check compares.
type Object ¶
type Object struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata Meta `json:"metadata"`
Template *PodTemplate `json:"-"`
}
Object is one document of a render. Template is nil for an object that has no pod template.
func Parse ¶
Parse splits a multi-document render into its objects. A document with no `kind` (an empty one, or only comments) is skipped.
type PodTemplate ¶
type PodTemplate struct {
Metadata Meta `json:"metadata"`
Spec struct {
// Containers is what makes a `template` a pod template: see
// podTemplate.
Containers []struct {
Name string `json:"name"`
} `json:"containers"`
Volumes []Volume `json:"volumes"`
} `json:"spec"`
}
PodTemplate is spec.template of a workload.