mirror of
https://github.com/holos-run/holos.git
synced 2026-03-21 17:55:01 +00:00
PROBLEM: The "Kustomize" tutorial has hardcoded code blocks and hasn't been updated to use the automated testscript workflow. SOLUTION: Create a test for the Kustomize tutorial. Create a testscript for the Kustomize test. Update the Kustomize MDX file to load in data from the testscript directory. OUTCOME: The code content in the Kustomize tutorial now comes directly from the testscript workflow.
31 lines
972 B
CUE
31 lines
972 B
CUE
package holos
|
|
|
|
// Produce a Kustomize BuildPlan for Holos
|
|
holos: Kustomize.BuildPlan
|
|
|
|
// https://github.com/mccutchen/go-httpbin/blob/v2.15.0/kustomize/README.md
|
|
Kustomize: #Kustomize & {
|
|
KustomizeConfig: {
|
|
// Files tells Holos to copy the file from the component path to the
|
|
// temporary directory Holos uses for BuildPlan execution.
|
|
Files: {
|
|
"httpbin.yaml": _
|
|
}
|
|
CommonLabels: {
|
|
"app.kubernetes.io/name": "httpbin"
|
|
}
|
|
// Kustomization represents a kustomization.yaml file in CUE. Holos
|
|
// marshals this field into a `kustomization.yaml` while processing a
|
|
// BuildPlan. See
|
|
// https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/
|
|
Kustomization: {
|
|
images: [{name: "mccutchen/go-httpbin"}]
|
|
// Use a hidden field to compose patches easily with a struct. Hidden
|
|
// fields are not included in exported structures.
|
|
_patches: {}
|
|
// Convert the hidden struct to a list.
|
|
patches: [for x in _patches {x}]
|
|
}
|
|
}
|
|
}
|