Documentation
¶
Overview ¶
Package manifest provides shared helpers for decoding, serializing, naming, and packaging Kubernetes manifest objects. It is producer-agnostic: rendered manifests from the Helm component, the Kubernetes component, or the Helmfile `template` path all flow through these helpers so they emit identical output and identical provision-artifact shapes for delivery targets (e.g. git).
Index ¶
- func ArtifactFiles(objects []*unstructured.Unstructured) (map[string][]byte, error)
- func DecodeObjects(data []byte) ([]*unstructured.Unstructured, error)
- func MultiDocumentYAML(objects []*unstructured.Unstructured) ([]byte, error)
- func ObjectFileName(index int, obj *unstructured.Unstructured) string
- func ObjectYAML(obj *unstructured.Unstructured) ([]byte, error)
- func ValidateRenderOptions(options RenderOptions) error
- func WriteObjects(objects []*unstructured.Unstructured, options RenderOptions) error
- type RenderOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArtifactFiles ¶
func ArtifactFiles(objects []*unstructured.Unstructured) (map[string][]byte, error)
ArtifactFiles builds a deterministic per-object file set (name -> YAML bytes) suitable for delivery to a provision target.
func DecodeObjects ¶
func DecodeObjects(data []byte) ([]*unstructured.Unstructured, error)
DecodeObjects decodes a multi-document YAML/JSON byte stream into a slice of unstructured objects. Embedded Kubernetes List objects are expanded into their individual items.
func MultiDocumentYAML ¶
func MultiDocumentYAML(objects []*unstructured.Unstructured) ([]byte, error)
MultiDocumentYAML serializes objects into a single multi-document YAML stream.
func ObjectFileName ¶
func ObjectFileName(index int, obj *unstructured.Unstructured) string
ObjectFileName returns a deterministic, filesystem-safe file name for an object, prefixed with its 1-based position so ordering is preserved.
func ObjectYAML ¶
func ObjectYAML(obj *unstructured.Unstructured) ([]byte, error)
ObjectYAML serializes a single object to YAML.
func ValidateRenderOptions ¶
func ValidateRenderOptions(options RenderOptions) error
ValidateRenderOptions verifies the output flag combination is valid.
func WriteObjects ¶
func WriteObjects(objects []*unstructured.Unstructured, options RenderOptions) error
WriteObjects writes the rendered objects according to the resolved output mode. With no Output/OutputDir set, the multi-document YAML is written to stdout.
Types ¶
type RenderOptions ¶
type RenderOptions struct {
// Output writes all objects to a single multi-document YAML file.
Output string
// OutputDir writes objects to a directory (a single manifest.yaml unless Split is set).
OutputDir string
// Split writes one file per object. Requires OutputDir.
Split bool
// Noun is the human-readable object noun used in status output (e.g. "Helm", "Kubernetes").
Noun string
// AtmosConfig controls TTY-aware syntax highlighting for stdout output.
AtmosConfig *schema.AtmosConfiguration
}
RenderOptions controls how rendered manifests are written.