8000 update helm test · nginx/kubernetes-ingress@b7c5547 · GitHub
[go: up one dir, main page]

Skip to content

Commit b7c5547

Browse files
committed
update helm test
Signed-off-by: Haywood Shannon <5781935+haywoodsh@users.noreply.github.com> Signed-off-by: Haywood Shannon <5781935+haywoodsh@users.noreply.github.com>
1 parent ca20778 commit b7c5547

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

charts/nginx-ingress/templates/_helpers.tpl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,14 +388,22 @@ volumes:
388388
List of volumes for controller.
389389
*/}}
390390
{{- define "nginx-ingress.volumeEntries" -}}
391+
{{- /* detect if a VCT named nginx-cache exists */ -}}
392+
{{- $flags := dict "hasCacheVCT" false -}}
393+
{{- range $i, $tpl := (.Values.controller.statefulset.volumeClaimTemplates | default (list)) -}}
394+
{{- if eq (default "" $tpl.metadata.name) "nginx-cache" -}}
395+
{{- $_ := set $flags "hasCacheVCT" true -}}
396+
{{- end -}}
397+
{{- end -}}
398+
391399
{{- if eq (include "nginx-ingress.readOnlyRootFilesystem" .) "true" }}
392400
- name: nginx-etc
393401
emptyDir: {}
394402
{{- if .Values.controller.cache.enableShared }}
395403
- name: nginx-cache
396404
persistentVolumeClaim:
397405
claimName: {{ .Values.controller.cache.sharedPVCName }}
398-
{{- else }}
406+
{{- else if not (get $flags "hasCacheVCT") }}
399407
- name: nginx-cache
400408
emptyDir: {}
401409
{{- end }}

charts/tests/__snapshots__/helmunit_test.snap

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12165,9 +12165,6 @@ spec:
1216512165

1216612166
- name: nginx-etc
1216712167
emptyDir: {}
12168-
- name: nginx-cache
12169-
persistentVolumeClaim:
12170-
claimName: nginx-cache
1217112168
- name: nginx-lib
1217212169
emptyDir: {}
1217312170
- name: nginx-state
@@ -12667,7 +12664,7 @@ spec:
1266712664

1266812665
- name: nginx-cache
1266912666
persistentVolumeClaim:
12670-
claimName: nginx-cache
12667+
claimName: nginx-shared-cache
1267112668
serviceAccountName: statefulset-shared-pvc-nginx-ingress
1267212669
automountServiceAccountToken: true
1267312670
securityContext:
@@ -13126,7 +13123,7 @@ spec:
1312613123
emptyDir: {}
1312713124
- name: nginx-cache
1312813125
persistentVolumeClaim:
13129-
claimName: nginx-cache
13126+
claimName: nginx-shared-cache
1313013127
- name: nginx-lib
1313113128
emptyDir: {}
1313213129
- name: nginx-state

charts/tests/testdata/statefulset-pvc-template-readonly.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
controller:
22
kind: statefulset
33
readOnlyRootFilesystem: true
4-
cache:
5-
enableShared: true
6-
sharedPVCName: nginx-cache
74
statefulset:
85
volumeClaimTemplates:
96
- metadata:

charts/tests/testdata/statefulset-shared-pvc-readonly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ controller:
33
readOnlyRootFilesystem: true
44
cache:
55
enableShared: true
6-
sharedPVCName: nginx-cache
6+
sharedPVCName: nginx-shared-cache

charts/tests/testdata/statefulset-shared-pvc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ controller:
22
kind: statefulset
33
cache:
44
enableShared: true
5-
sharedPVCName: nginx-cache
5+
sharedPVCName: nginx-shared-cache

0 commit comments

Comments
 (0)
0