This repository was archived by the owner on May 16, 2023. It is now read-only.
File tree 3 files changed +26
-0
lines changed
3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 25
25
volumeClaimTemplates :
26
26
- metadata :
27
27
name : {{ template "logstash.fullname" . }}
28
+ {{- if .Values.persistence.labels.enabled }}
29
+ labels :
30
+ app : " {{ template " logstash.fullname" . }}"
31
+ chart : " {{ .Chart.Name }}"
32
+ heritage : {{ .Release.Service | quote }}
33
+ release : {{ .Release.Name | quote }}
34
+ {{- range $key, $value := .Values.labels }}
35
+ {{ $key }}: {{ $value | quote }}
36
+ {{- end }}
37
+ {{- end }}
28
38
{{- with .Values.persistence.annotations }}
29
39
annotations :
30
40
{{ toYaml . | indent 8 }}
Original file line number Diff line number Diff line change @@ -301,6 +301,19 @@ def test_adding_persistence():
301
301
assert v ["spec" ]["resources" ]["requests" ]["storage" ] == "1Gi"
302
302
303
303
304
+ def test_adding_persistence_label_in_volumeclaimtemplate ():
305
+ config = """
306
+ persistence:
307
+ enabled: true
308
+ labels:
309
+ enabled: true
310
+ """
311
+ r = helm_template (config )
312
+ v = r ["statefulset" ][name ]["spec" ]["volumeClaimTemplates" ][0 ]["metadata" ]["labels" ]
313
+ sts = r ["statefulset" ][name ]["metadata" ]["labels" ]
314
+ assert v == sts
315
+
316
+
304
317
def test_adding_storageclass_annotation_to_volumeclaimtemplate ():
305
318
config = """
306
319
persistence:
Original file line number Diff line number Diff line change @@ -126,6 +126,9 @@ podSecurityPolicy:
126
126
127
127
persistence :
128
128
enabled : false
129
+ # Add default labels for the volumeClaimTemplate fo the StatefulSet
130
+ labels :
131
+ enabled : false
129
132
annotations : {}
130
133
131
134
extraVolumes :
You can’t perform that action at this time.
0 commit comments