Is your feature request related to a problem? Please describe.
helm2cue relies heavily on struct embedding for helper includes. When a helper produces structured YAML (labels, annotations, etc.), the generated CUE embeds the helper reference into the parent struct:
metadata: {
name: "test"
labels: {
_myapp_labels
extra: "field"
}
}
The current CUE embedding semantics implicitly open closed structs, which can have surprising interactions with schema validation. The generated CUE works correctly today, but the implicit opening behavior means the relationship between embedding and struct closedness is not always obvious from reading the output.
Describe the solution you'd like
CUE's proposed experiment to eliminate embedding-based struct opening (cue-lang/cue#4032) introduces an explicit postfix ... operator for recursively opening composite structs. Instead of implicit opening through embedding, code would use {x...} to explicitly open a struct.
Explore this experiment to:
- Determine whether helm2cue's embedding patterns need the implicit opening behavior, or whether explicit
... would be more correct.
- Evaluate what changes to the generated CUE would be needed under the new semantics.
- Check whether any current output relies on implicit opening and would break.
- Provide feedback on the proposal from the perspective of a code generator.
Additional context
Upstream discussion: cue-lang/cue#4032
Is your feature request related to a problem? Please describe.
helm2cue relies heavily on struct embedding for helper includes. When a helper produces structured YAML (labels, annotations, etc.), the generated CUE embeds the helper reference into the parent struct:
The current CUE embedding semantics implicitly open closed structs, which can have surprising interactions with schema validation. The generated CUE works correctly today, but the implicit opening behavior means the relationship between embedding and struct closedness is not always obvious from reading the output.
Describe the solution you'd like
CUE's proposed experiment to eliminate embedding-based struct opening (cue-lang/cue#4032) introduces an explicit postfix
...operator for recursively opening composite structs. Instead of implicit opening through embedding, code would use{x...}to explicitly open a struct.Explore this experiment to:
...would be more correct.Additional context
Upstream discussion: cue-lang/cue#4032