Skip to content

Commit 5c4172b

Browse files
authored
fix: resolve duplicate volume claims in PVC handling logic (#82)
* fix: resolve duplicate volume claims in PVC handling logic * fix: correct indentation for internal PVC volume condition in deployment.yaml
1 parent bd79e25 commit 5c4172b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

helm/templates/deployment.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
{{- $imageTag := include "overseer.tag" . -}}
99
{{- $storage := (include "common.storage.merged" .) | fromYaml }}
1010

11+
{{- /* PVC handling - check if both PVCs point to the same claim */ -}}
12+
{{- $samePvc := and $storage.fs.ingestionSourcePvc.enabled $storage.fs.internalPvc.enabled (eq $storage.fs.internalPvc.name $storage.fs.ingestionSourcePvc.name) }}
13+
{{- $internalVolumeName := ternary "ingestion-storage" "internal-storage" $samePvc }}
14+
1115
{{ $gpkgPath := (printf "%s/%s" $storage.fs.internalPvc.mountPath $storage.fs.internalPvc.gpkgSubPath) }}
1216

1317
{{- if .Values.enabled -}}
@@ -66,7 +70,7 @@ spec:
6670
{{- end }}
6771
volumeMounts:
6872
{{- if $storage.fs.internalPvc.enabled }}
69-
- name: internal-storage
73+
- name: {{ $internalVolumeName }}
7074
mountPath: {{ $storage.fs.internalPvc.mountPath }}
7175
{{- end }}
7276
{{- if $storage.fs.ingestionSourcePvc.enabled }}
@@ -141,7 +145,7 @@ spec:
141145
{{- tpl (toYaml .Values.sidecars) . | nindent 8 }}
142146
{{- end }}
143147
volumes:
144-
{{- if $storage.fs.internalPvc.enabled }}
148+
{{- if and $storage.fs.internalPvc.enabled (not $samePvc) }}
145149
- name: internal-storage
146150
persistentVolumeClaim:
147151
claimName: {{ $storage.fs.internalPvc.name }}
@@ -150,7 +154,7 @@ spec:
150154
- name: ingestion-storage
151155
persistentVolumeClaim:
152156
claimName: {{ $storage.fs.ingestionSourcePvc.name }}
153-
{{- end }}
157+
{{- end }}
154158
- name: nginx-config
155159
configMap:
156160
name: 'nginx-extra-configmap'

0 commit comments

Comments
 (0)