Replies: 2 comments
-
Add a package p
// https://cuetorials.com/first-steps/import-configuration/
// cue import -f -o data.cue -l 'data:' -l 'strings.ToLower(kind)' -l 'metadata.name' -p p input.yaml
// cue cmd dump
import (
"encoding/yaml"
"tool/cli"
"list"
)
data_list: [
for k, v in data {
[for k2, v2 in v {
v2
}]
}
]
command: dump: {
task: print: cli.Print & {
text: yaml.MarshalStream(list.FlattenN(data_list, -1))
}
} Run: Run: The trick is in the The kubernetes tutorial has something along the lines of:
To create the list. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm using timoni as a kustomize replacement. It uses cue but is a bit more opinionated so you don't feel you're reinventing the wheel. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently evaluating the feasibility of replacing Kustomize with Cuelang in our project. Unfortunately, I'm stumbling quite early. According to this guide, you define your k8s objects like this:
So, all definitions are nested in some kind of "struct" (my terminology is certainly off, here). The guide then shows how to export everything to yaml:
Of course, all entries are empty because I did not really define anything specific. But my question is: Given that there was some actual content - how would I extract all nested configurations so that I get a ready to use (by kubectl) list of manifests?
Beta Was this translation helpful? Give feedback.
All reactions