Skip to content

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

Description

@myitcv

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions