I noted the environment variables for NOMAD_META come in both upper and lower case and my question is pretty stupid, but I’d like to know.

Is there a difference? Should I prefer one to the other? I searched the docs but I couldn’t find anything about this.


Hi @jrwren, from my understanding NOMAD_META variables are always upper case. Could you provide details of the situation you’re seeing and how it could be reproduced so I may be able to take a further look?

jrasell and the Nomad team

Hi @jrasell, in my case, the nomad task starts a docker container and the entry point of that container is a bash script which uses these environment variables. I noticed the bash script uses both ${NOMAD_META_CONSULDC} in one location and ${NOMAD_META_consuldc} in another location. I find the inconsistency disappointing. The nomad job defined lowercase consuldc="whatever" in the meta section.

If I run a bash shell in the container using docker exec and run env I see both upper and lower case environment variables for all of the meta vars. It is easy to see with env | grep -i nomad | sort -f.

I’m a complete newbie to nomad. I’m still trying to wrap my head around what makes a job easy to read and maintainable and same for a bash script which uses env vars from the job. It is a couple of days later now and I’m leaning toward preferring the lowercase NOMAD_META_var to NOMAD_META_VAR for no other reason than it is var in the job and not VAR, but I’m still curious if there is a reason for both which I should know about.