Skip to content

Commit 8cd8301

Browse files
fix: persistent volume retention (#1350)
This patch adds annotations to PVCs to avoid their pruning. This means they will not be automatically deleted when they do not exist in the "desired state". This has been tested by being deployed to P49, then switching BlueAPI between 1.11.2 and 1.11.3 and checking that changes to the scratch area persist between PVC swaps.
1 parent 162ef03 commit 8cd8301

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

helm/blueapi/templates/volumes.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ kind: PersistentVolumeClaim
44
metadata:
55
name: {{ include "blueapi.fullname" . }}-scratch-{{ .Values.image.tag | default .Chart.AppVersion }}
66
annotations:
7-
helm.sh/resource-policy: keep
7+
argocd.argoproj.io/sync-options: Prune=false,Delete=false
8+
argocd.argoproj.io/compare-options: IgnoreExtraneous
89
spec:
910
accessModes:
1011
- ReadWriteMany

tests/unit_tests/test_helm_chart.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,10 @@ def test_persistent_volume_claim_exists(
600600
"kind": "PersistentVolumeClaim",
601601
"metadata": {
602602
"name": "blueapi-scratch-0.1.0",
603-
"annotations": {"helm.sh/resource-policy": "keep"},
603+
"annotations": {
604+
"argocd.argoproj.io/sync-options": "Prune=false,Delete=false",
605+
"argocd.argoproj.io/compare-options": "IgnoreExtraneous",
606+
},
604607
},
605608
"spec": {
606609
"accessModes": ["ReadWriteMany"],

0 commit comments

Comments
 (0)