-
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
Placeholder for old PR #841 #841
Comments
Original reply by @verdverm in cuelang/cue#841 (comment) For reference, this topic came up about a year ago. cuelang/cue#350 (there was more in slack) The TL;DR is that there is concern about fracturing the ecosystem. If you add custom builtins, then you cannot read or process your Cue with the Cue CLI (reference implementation). This in effect creates dialects that only your tool can process. This may be ok for you and your tool, however, were this to happen with many tools, then people see examples of "Cue" from these many tools, ( each with their own dialect ), then people get confused about "Why does this Cue that I see over there does not work here? Why is the Cue CLI telling me this doesn't exist?" So if you make a tool that creates a dialect of Cue, it might not really be Cue anymore depending on who you ask. There are a few existing capabilities and proposals that may make help you:
|
Original reply by @morlay in cuelang/cue#841 (comment) @verdverm I know your concerns. I'm not care how many tools i have to use, but if I want to bring a new good thing (cuelang is cool) to my team. Recently, I'm bringing my team to get away from helm, So i start to create a new tool to solve my problems base the cuelang - https://github.com/octohelm/cuemod Totally copy features from go modules. With adding new life cycle before mod load, I hope the workflow could be easy like: mkdir -p ./demo && cd ./demo
cat << EOT > kube.cue
package kube
import (
apps_v1 "k8s.io/api/apps/v1"
)
deployment: [string]: apps_v1.#Deployment
_labels: { "app": "nginx" }
deployment: nginx: spec: selector: matchLabels: _labels
deployment: nginx: spec: template: metadata: labels: _labels
deployment: nginx: spec: template: spec: {
containers: [{
name: "nginx"
image: "nginx:1.11.10-alpine"
}]
}
EOT
cuem eval ./kube.cue And now, I have lots of helm charts and jsonnet. I can't refactor all of them to cue. JSONNET: https://github.com/octohelm/cuemod/blob/main/pkg/cuemod/testdata/b/jsonnet_demo/jsonnet.cue This why the PR here. I really need add custom pkg to make it works in cue before i refactored. using |
Original reply by @morlay in cuelang/cue#841 (comment) I think i could write a custom MarshalJSON to replace the cue.Value which with special tag.
But the decl attrs. seems have to wait cuelang/cue#529 |
Original reply by @myitcv in cuelang/cue#841 (comment) @morlay thanks for starting a discussion on this. Generally speaking it's preferable to open a GitHub issue/discussion before a PR/Gerrit change (the Go project follows a similar model). PRs/Gerrit changes can easily follow later, once we have agreed and fleshed out a design and direction. If there isn't an issue that corresponds well to what you're after, please feel free to open a new one. Thanks |
Original reply by @morlay in cuelang/cue#841 (comment) @verdverm i follow your suggestions. It works. https://github.com/octohelm/cuemod#post-processing-translatename. Only a limit here, we can't use the translated results in cue any more. |
Originally raised by @morlay in cuelang/cue#841
The text was updated successfully, but these errors were encountered: