Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(paths []string, opts Options) (objects []*unstructured.Unstructured, warnings []string, err error)
Load reads Kubernetes manifests from the provided paths (files, directories, or "-" for stdin), decodes them into unstructured objects, expands List kinds into items, applies best-effort default namespace for namespaced objects, and returns the resulting objects alongside non-fatal warnings.
Behavior: - Directories are traversed; only .yaml/.yml/.json files are decoded. - Multi-document YAML is supported. - Kind: List is expanded into individual items. - Objects without apiVersion/kind are ignored.
Returns: - objects: slice of decoded unstructured objects. - warnings: slice of non-fatal issues encountered (e.g., skipped files). - err: fatal error (e.g., read permissions, malformed YAML that cannot be recovered).
Types ¶
type Options ¶
type Options struct {
// DefaultNamespace is applied to objects missing a namespace when those objects
// are namespaced-scoped (best-effort heuristic).
DefaultNamespace string
// Recursive controls whether directory traversal should recurse into subdirectories.
Recursive bool
// Stdin can be set to override the reader when paths contain "-".
// If nil, os.Stdin will be used.
Stdin io.Reader
}
Options configure manifest loading.