-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: add encoding/cue to encode/decode cue code to/from a string #1852
Comments
Thanks, @Somefive. Noting per our discussion that this is something that has been discussed before, although I can't find a good issue/discussion that captures that discussion. So thanks for creating this issue. Noting some of the main challenges we have identified in these conversations:
|
The |
This would be quite useful for Thema, as well. |
This one's priority is medium and we have some workaround. But the workarounds need to use Not user-facing. |
I believe that might be #423, although given its inactivity, I think we should close that one as a duplicate of this one even though this one is newer. |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
In KubeVela, we use pure CUE file to write and organize render logics but the code is embedded as YAML object while deployed into Kubernetes cluster.
For example, the following CUE file will be converted into the following YAML object.
Reference:
Currently, we use
vela def render
command to do the conversion. The conversion logic includes:template
field and convert into string and fill it intospec.schematic.cue.template
.Therefore, although the YAML object can be rendered from the CUE file, the CUE file itself is not actually cue native, as the fields in the
template
field are actually isolated from other fields.Describe the solution you'd like
A clear and concise description of what you want to happen.
If we have some internal function like
cue.Marshal
fromencoding/cue
, just likeencoding/json
andjson.Marshal
, we can make the CUE rendering process more elegant. For example, with this function we can write,And then we could use
cue eval scaler.cue -e output -d yaml | kubectl apply -f -n vela-system -
to get the rendered YAML object and apply it into Kubernetes cluster directly.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: