Replies: 2 comments
-
Do you have a working example of what you're trying to do? In general, if you're generating or templating values, you wouldn't use optional fields. Or if you're validating, then you'd use either optional fields or required fields (the latter is added in v0.6.0-alpha.1). Ideally you wouldn't mix the two scenarios. |
Beta Was this translation helpful? Give feedback.
-
I would like to generate both the helm values.yaml file and the helm values.schema.json file from one cuefile, which contains all the schema (as cue does by default anyway), and the default values (which should then make the values.yaml file). From my understanding of cue, this is just not something that is possible at the moment (and maybe never, which is fair enough!). We are just looking for some tool that solves the problem of having to write the default values in the values.yaml file and keeping a schema in-sync with that and the sources.. having just one cuefile that has both would be much easier to handle. Ideally, this could also be used to generate documentation on the generated schema :D I hope this explains it, if not, please tell me, then I'll try to elaborate. As an example:
would be used to generate json schema (probably via openapi, as that's the only export format at the moment, right?), and it could also be used to generate a values.yaml like:
|
Beta Was this translation helpful? Give feedback.
-
Hello!
I'd like to use cue to generate and validate helm values.yaml files (and generate their related values.schema.json).
If I set a label as optional, and also include a default value, it will not be exported on
cue export
. Is there any way to get cue to also export all labels that have (possibly deeply-nested) default values?Thanks for any help with this!
Beta Was this translation helpful? Give feedback.
All reactions