@@ -39,7 +39,10 @@ Create the name of the config map S3 to use
3939{ {- $service := ( index $secret .data " elastic-service" | default " " ) | b64dec } }
4040{ {- $name := ( index $secret .data " elastic-name" | default " " ) | b64dec } }
4141{ {- $port := ( index $secret .data " elastic-port" ) | b64dec } }
42- { {- $data := dict " elastic" $elastic " service" $service " name" $name " port" $port } }
42+ { {- $password := ( index $secret .data " elastic-password" | default " " ) | b64dec } }
43+ { {- $tls := ( index $secret .data " elastic-tls" | default " ZmFsc2U=" ) | b64dec } }
44+ { {- $username := ( index $secret .data " elastic-username" | default " " ) | b64dec } }
45+ { {- $data := dict " elastic" $elastic " service" $service " name" $name " port" $port " password" $password " username" $username " tls" $tls } }
4346{ {- if $test } }
4447{ { printf " databases:" | indent 2 } }
4548{ {- $test = 0} }
@@ -96,12 +99,23 @@ Create the name of the config map S3 to use
9699{ {- $service := .service } }
97100{ {- $port := .port } }
98101{ {- $name := .name } }
102+ { {- $username := .username } }
103+ { {- $password := .password } }
104+ { {- $tls := .tls } }
99105{ {- if $elastic } }
100106{ { printf " - allow_file_upload: true" | indent 2} }
101107{ { printf " allow_ctas: true" | indent 4} }
102108{ { printf " allow_cvas: true" | indent 4} }
103109{ { printf " database_name: %s" $name | indent 4} }
110+ { {- if eq $tls " true" } }
111+ { {- if and $password $username } }
112+ { { printf " sqlalchemy_uri: elasticsearch+https://%s:%s@%s:%s/" $username $password $service $port | indent 4 } }
113+ { {- else } }
114+ { { printf " sqlalchemy_uri: elasticsearch+https://%s:%s/" $service $port | indent 4 } }
115+ { {- end } }
116+ { {- else } }
104117{ { printf " sqlalchemy_uri: elasticsearch+http://%s:%s/" $service $port | indent 4} }
118+ { {- end } }
105119{ { printf " tables: []" | indent 4} }
106120{ {- end } }
107121{ {- end -} }
0 commit comments