Skip to content

Commit

Permalink
Merge pull request #21 from QingCloudAppcenter/bugfix/script-args
Browse files Browse the repository at this point in the history
Fix script.* issue
  • Loading branch information
hlwanghl authored Aug 19, 2019
2 parents d587782 + 13f6a19 commit 5116414
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ discoveryHosts="${masterNodes:-$genericNodes}"
dataDirs="$(ls -d /data* | xargs echo)"
dataDirs="$(echo "${dataDirs:-/data /data2 /data3} " | sed 's# #/elasticsearch/data, #g')"

scriptTypes="
{{- range ls "/env" | filter "(inline|stored|file)" }}
{{ if eq (getv (printf "/env/%s" .)) "true" }}{{ replace . "script." "" -1 }}{{ end }}
{{- end }}
"
scriptTypes="$(echo $scriptTypes)"
scriptTypes="${scriptTypes// /,}"

scriptContexts="
{{- range ls "/env" | filter "(aggs|search|update)" }}
{{ if eq (getv (printf "/env/%s" .)) "true" }}{{ replace . "script." "" -1 }}{{ end }}
{{- end }}
"
scriptContexts="$(echo $scriptContexts)"
scriptContexts="${scriptContexts// /,}"

cat > /opt/app/conf/elasticsearch/elasticsearch.yml << ES_YML_EOF
action.destructive_requires_name: {{ getv "/env/action.destructive_requires_name" "true" }}
bootstrap.memory_lock: true
Expand Down Expand Up @@ -116,8 +100,9 @@ reindex.remote.whitelist: "{{ getv "/env/reindex.remote.whitelist" "" }}"
{{- end }}
repositories.url.allowed_urls: {{ getv "/env/repositories.url.allowed_urls" "[]" }}

script.allowed_contexts: ${scriptContexts:-none}
script.allowed_types: ${scriptTypes:-none}
{{- range gets "/env/script.*" }}
{{ base .Key }}: {{ .Value }}
{{- end }}

{{- range getvs "/env/es_additional_line*" }}
{{ . }}
Expand Down
8 changes: 4 additions & 4 deletions app/cluster.json.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-fv5krcqs"
"image": "img-jvs3zqzm"
},
"instance_class": {{cluster.es_node.instance_class}},
"count": {{cluster.es_node.count}},
Expand Down Expand Up @@ -235,7 +235,7 @@
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-fv5krcqs"
"image": "img-jvs3zqzm"
},
"instance_class": {{cluster.es_master_node.instance_class}},
"count": {{cluster.es_master_node.count}},
Expand Down Expand Up @@ -441,7 +441,7 @@
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-fv5krcqs"
"image": "img-jvs3zqzm"
},
"instance_class": {{cluster.es_node_2.instance_class}},
"count": {{cluster.es_node_2.count}},
Expand Down Expand Up @@ -656,7 +656,7 @@
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-fv5krcqs"
"image": "img-jvs3zqzm"
},
"instance_class": {{cluster.es_node_3.instance_class}},
"count": {{cluster.es_node_3.count}},
Expand Down

0 comments on commit 5116414

Please sign in to comment.