Open blalor opened 7 years ago
Hah, good find! I'll clean this up.
Hmm, that is unfortunate. Arrived via https://github.com/appc/spec/commit/08f169c5ba43ae032fe7bf36aa6a10fe86e35afa#diff-916b3e1e005fd96e3a0546715235477dR523
Are you passing this through to elasticsearch via a script or something..?
Looks like Linux allows anything except nulls in environment variables.
@jonboulle I am. It's a custom script, and I came up with a workaround of encoding dots as ES
:
## configure from env vars; cribbed from
## https://github.com/elastic/elasticsearch-docker/blob/af148c7f486ef6e78718da0f9e2a314851b6dea6/build/elasticsearch/bin/es-docker
## encoding '.' as 'ES'
while IFS='=' read -r envvar_key envvar_value ; do
# Elasticsearch env vars need to have at least two ES-separated lowercase
# words, e.g. `clusterESname`
if [[ "$envvar_key" =~ ^[a-z]+ES[a-z]+ ]] ; then
if [[ ! -z $envvar_value ]]; then
newopt="-E${envvar_key//ES/.}=${envvar_value}"
echo "adding param: '${newopt}'"
launch_cmd=("${launch_cmd[@]}" "${newopt}")
fi
fi
done < <( env )
So cluster.name
becomes clusterESname
. It's ugly. And a better solution would be to pass these as arguments to the script instead of environment variables.
While I think adopting the IEEE spec for environment variables is well-intentioned, it goes against Postel's law. :-)
I'll also point out that you can't directly access environment variables with dots in them via bash. But this isn't the first time I've had to do something like this, so from a user's perspective, it'd be preferable to have rkt (and the spec, I guess) be a little more forgiving.
Sure, I think we can just loosen this up.
This needs an appc bump, which did not happen yet, hence bumping to the next release.
This is not on our radar at the moment, but it should be easy enough to tackle for external contributors. Contributions welcome!
welp.. no updates ?
Environment
What did you do?
What did you expect to see?
What did you see instead?