Skip to main content

Module kustomize

Module kustomize 

Source
Expand description

Kustomize build operations.

Ported from internal/backends/kustomize/{interface,client}.go. Go builds in process against the kustomize Go library (krusty), never shelling out to a kustomize binary – there is no Rust equivalent of krusty to link against. This port instead shells out to the real kustomize build binary via [xianyun_executor::exec:: CommandRunner] (the same mechanism every other backend in this crate uses), which gives generator (secretGenerator/ configMapGenerator) and replacements support – and kustomize’s own remote-target resolution – for free, rather than hand-rolling a partial reimplementation of kustomize’s YAML processing semantics. See PORT_NOTES.md for the full design rationale.

FileSystem (this crate’s own invention, not a port of sigs.k8s. io/kustomize/kyaml/filesys.FileSystem) still exists so unit tests can stay hermetic: Client::build walks and reads the kustomize directory through this trait, stages a copy on a real temporary directory (the real kustomize binary can only read from disk), and then invokes the real binary against that staging copy. A remote target (file://...//overlay?ref=..., https://..., …) bypasses FileSystem and staging entirely: kustomize resolves those itself (shallow git clone included), so the target string is passed straight through to the binary.

Modules§

remote
Remote kustomize target helpers.

Structs§

Client
Ported from Client in client.go.
DiskFileSystem
The real on-disk FileSystem: Go’s zero-argument NewClient defaults to filesys.MakeFsOnDisk(), and production callers of this port’s Client::new need the equivalent – every FileSystem implementor elsewhere in the workspace is test-only (an in-memory map), since nothing needed a real-disk one until a production caller (the deployer::kustomize manager) had an on-disk kustomization directory, built by builtin::materialize_builtin_overlay, to build.

Enums§

KustomizeError
Ported from the error Client::Build wraps: kustomizer.Run / resources.AsYaml failures, and context cancellation.

Traits§

Backend
Ported from the Backend interface in interface.go.
FileSystem
Ported from the subset of sigs.k8s.io/kustomize/kyaml/filesys. FileSystem that Client::build needs: WriteFile/ReadFile (for test fixtures to populate a hermetic directory tree) plus walk, which this port adds so Client::build can enumerate every file under a directory to stage it onto real disk before invoking the real kustomize binary. walk defaults to “unsupported” so existing FileSystem implementors elsewhere in the workspace (which predate this method) keep compiling without needing to implement it themselves; an implementor that wants its fixtures to exercise real generator/replacement builds through Client::build must override it.