mirror of
https://github.com/apache/druid.git
synced 2025-02-23 03:03:02 +00:00
Fix parsing of env variables when properties have underscores (#15919)
* Fix parsing of env variables when properties have underscores * Add documentation * Use a % sign instead
This commit is contained in:
parent
bcce0806d7
commit
59bb72a926
@ -148,7 +148,7 @@ env | grep ^druid_ | while read evar;
|
||||
do
|
||||
# Can't use IFS='=' to parse since var might have = in it (e.g. password)
|
||||
val=$(echo "$evar" | sed -e 's?[^=]*=??')
|
||||
var=$(echo "$evar" | sed -e 's?^\([^=]*\)=.*?\1?g' -e 's?_?.?g')
|
||||
var=$(echo "$evar" | sed -e 's?^\([^=]*\)=.*?\1?g' -e 's?__?%UNDERSCORE%?g' -e 's?_?.?g' -e 's?%UNDERSCORE%?_?g')
|
||||
setKey $SERVICE "$var" "$val"
|
||||
done
|
||||
|
||||
|
@ -107,7 +107,7 @@ env | grep ^druid_ | while read evar;
|
||||
do
|
||||
# Can't use IFS='=' to parse since var might have = in it (e.g. password)
|
||||
val=$(echo "$evar" | sed -e 's?[^=]*=??')
|
||||
var=$(echo "$evar" | sed -e 's?^\([^=]*\)=.*?\1?g' -e 's?_?.?g')
|
||||
var=$(echo "$evar" | sed -e 's?^\([^=]*\)=.*?\1?g' -e 's?__?%UNDERSCORE%?g' -e 's?_?.?g' -e 's?%UNDERSCORE%?_?g')
|
||||
setKey $SERVICE "$var" "$val"
|
||||
done
|
||||
|
||||
|
@ -90,7 +90,10 @@ The custom template pod adapter allows you to specify a pod template file per ta
|
||||
|
||||
The base pod template must be specified as the runtime property `druid.indexer.runner.k8s.podTemplate.base: /path/to/basePodSpec.yaml`
|
||||
|
||||
Task specific pod templates can be specified as the runtime property `druid.indexer.runner.k8s.podTemplate.{taskType}: /path/to/taskSpecificPodSpec.yaml` where {taskType} is the name of the task type i.e `index_parallel`
|
||||
Task specific pod templates can be specified as the runtime property `druid.indexer.runner.k8s.podTemplate.{taskType}: /path/to/taskSpecificPodSpec.yaml` where {taskType} is the name of the task type i.e `index_parallel`.
|
||||
|
||||
If you are trying to use the default image's environment variable parsing feature to set runtime properties, you need to add a extra escape underscore when specifying pod templates.
|
||||
e.g. set the environment variable `druid_indexer_runner_k8s_podTemplate_index__parallel` when setting `druid.indxer.runner.k8s.podTemplate.index_parallel`
|
||||
|
||||
The following is an example Pod Template that uses the regular druid docker image.
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user