Skip to content
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

003_kubernetes_tutorial: avoid use of strings.ToCamel? #28

Open
myitcv opened this issue Mar 13, 2024 · 0 comments
Open

003_kubernetes_tutorial: avoid use of strings.ToCamel? #28

myitcv opened this issue Mar 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@myitcv
Copy link
Contributor

myitcv commented Mar 13, 2024

Per @mogsie on Slack:


Why do all the examples of kubernetes resources on cuelang dot org use the ToCamel function when importing kind?

cue import ./... -p kube -l 'strings.ToCamel(kind)' -l metadata.name -f

I understand that you then get a more consistent set of data, but IMHO it sets a bad precedence, because the root object and kind property are no longer aligned (incorrect casing). If you have a custom resource with a few capital letters like, say HTTPRoute then this gets imported as

hTTPRoute: blah: {}

In short, we removed the strings.ToCamel when we import kubernetes resources and are quite happy with ConfigMap: foo: {} style data structures. In a way configMap looks like a typo, because that's not its kind

@myitcv myitcv added the bug Something isn't working label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant