tazjin/kontemplate

Document valid format for variable names

alajmo opened this issue · 3 comments

Seems camelCasing / PascalCasing / snake_casing is supported but not lisp-case(hello_world). Would be nice if it said in the documentation what casing is supported and preferably throw an explanatory error when user uses lisp-case.

Hey!

The templating engine is the one from Go itself. I'll see if there are docs on what sorts of namings it supports, but I don't think I can do much about the errors that it throws without first performing a lot of custom validation.

Thanks for filing the issue :-)

Edit: Valid identifier names are documented here in the Golang specification. The unicode_letter type includes valid unicode letters and digits, as well as the underscore, but no hyphen.

I'll see if I can prominently add this to the docs as a part of #67

Ah cheers. Yeah I reckoned it was from Go. Still like you mentioned, it would be nice just to have it somewhere in the documentation so users are aware, since

  template:
    metadata:
      labels:
        lala-lala: lala

is valid yaml, and k8s seems to allow it with the flag --dry-run. Also, k8s users aren't expected to be familiar with Go in general.

That should work fine though, you can have lisp-case in the output just not in the names of the (user-defined) variables.