File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 20
20
# ###############################
21
21
# # Elasticsearch Secret
22
22
# ################################
23
- {{- if (and .Values.elasticsearch.enabled (not .Values.elasticsearch.secretName)) }}
23
+ {{- if (and .Values.elasticsearch.enabled (or ( not .Values.elasticsearch.secretName) .Values.elasticsearch.alwaysGenerateSecret )) }}
24
24
apiVersion : v1
25
25
kind : Secret
26
26
metadata :
27
- name : {{ include "airflow.fullname " . }}-elasticsearch
27
+ name : {{ template "elasticsearch_secret " . }}
28
28
labels :
29
29
release : {{ .Release.Name }}
30
30
chart : {{ .Chart.Name }}
@@ -33,12 +33,14 @@ metadata:
33
33
{{- toYaml . | nindent 4 }}
34
34
{{- end }}
35
35
type : Opaque
36
+ {{- with .Values.elasticsearch.connection }}
37
+ {{- if . }}
36
38
data :
37
- {{- with .Values.elasticsearch.connection }}
38
- {{- if and .user .pass }}
39
- connection : {{ urlJoin (dict "scheme" (default "http" .scheme) "userinfo" (printf "%s:%s" (.user | urlquery) (.pass | urlquery)) "host" (printf "%s:%s" .host ((default 9200 .port) | toString) ) ) | b64enc | quote }}
40
- {{- else }}
41
- connection : {{ urlJoin (dict "scheme" (default "http" .scheme) "host" (printf "%s:%s" .host ((default 9200 .port) | toString))) | b64enc | quote }}
42
- {{- end }}
39
+ {{- if and .user .pass }}
40
+ connection : {{ urlJoin (dict "scheme" (default "http" .scheme) "userinfo" (printf "%s:%s" (.user | urlquery) (.pass | urlquery)) "host" (printf "%s:%s" .host ((default 9200 .port) | toString) ) ) | b64enc | quote }}
41
+ {{- else }}
42
+ connection : {{ urlJoin (dict "scheme" (default "http" .scheme) "host" (printf "%s:%s" .host ((default 9200 .port) | toString))) | b64enc | quote }}
43
43
{{- end }}
44
44
{{- end }}
45
+ {{- end }}
46
+ {{- end }}
Original file line number Diff line number Diff line change 8000
8000
],
8001
8001
"default": null
8002
8002
},
8003
+ "alwaysGenerateSecret": {
8004
+ "description": "Whether to generate a secret even if secret name is specified.",
8005
+ "type": "boolean",
8006
+ "default": false
8007
+ },
8003
8008
"connection": {
8004
8009
"description": "Elasticsearch connection configuration.",
8005
8010
"type": "object",
Original file line number Diff line number Diff line change @@ -2463,6 +2463,8 @@ elasticsearch:
2463
2463
enabled : false
2464
2464
# A secret containing the connection
2465
2465
secretName : ~
2466
+ # Whether to generate a secret even if secret name is specified
2467
+ alwaysGenerateSecret : false
2466
2468
# Or an object representing the connection
2467
2469
# Example:
2468
2470
# connection:
You can’t perform that action at this time.
0 commit comments