Skip to content

Commit 2c4a2e6

Browse files
committed
fix: create PVC only if using the default PVC name
We should create a PVC only if the default PVC name has not changed. If the name has changed, it means our users want to use their own pre-provisioned PVC. In such cases it would be an error to create a PVC as it would result in a conflict - the PVC already exists.
1 parent 88a2f5d commit 2c4a2e6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

snyk-monitor/templates/pvc.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
{{ if .Values.pvc.enabled }}
1+
# We create a PVC only if the default PVC name has not changed.
2+
# If the name has changed, it means our users want to use their own pre-provisioned PVC.
3+
# In such cases it would be an error to create a PVC as it would result in a conflict - the PVC already exists.
4+
{{- if .Values.pvc.enabled }}{{- if eq .Values.pvc.name "snyk-monitor-pvc" }}
25
kind: PersistentVolumeClaim
36
apiVersion: v1
47
metadata:
@@ -11,4 +14,4 @@ spec:
1114
requests:
1215
storage: {{ .Values.temporaryStorageSize }}
1316
storageClassName: {{ .Values.pvc.storageClassName }}
14-
{{ end }}
17+
{{- end }}{{- end }}

snyk-monitor/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ temporaryStorageSize: 50Gi # Applies to PVC too
3939
# Change to true to use a PVC instead of emptyDir for local storage
4040
pvc:
4141
enabled: false
42-
name: 'snyk-monitor-pvc'
42+
name: snyk-monitor-pvc
4343
storageClassName: null
4444

4545
# Node.js in-container process memory enhancements

0 commit comments

Comments
 (0)