Skip to content

Commit

Permalink
Include a hash in the pv/pvc names
Browse files Browse the repository at this point in the history
  • Loading branch information
bpblanken committed Apr 3, 2024
1 parent c71f4fd commit 9a1109b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/hail-search/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.46
version: 0.1.47
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand Down
2 changes: 1 addition & 1 deletion charts/hail-search/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
{{- if .Values.persistentVolume.enabled }}
persistentVolumeClaim:
readOnly: true
claimName: {{ include "hail-search.fullname" . }}-pvc
claimName: {{ include "hail-search.fullname" . }}-pvc-{{ .Values.persistentVolume.volumeHandle | sha256sum | trunc 5 }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/hail-search/templates/persistentvolume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ include "hail-search.fullname" . }}-pv
name: {{ include "hail-search.fullname" . }}-pv-{{ print .Values.persistentVolume.volumeHandle | sha256sum | trunc 5}}
labels:
{{- include "hail-search.labels" . | nindent 4 }}
spec:
Expand All @@ -12,7 +12,7 @@ spec:
accessModes:
- ReadOnlyMany
volumeMode: Filesystem
persistentVolumeReclaimPolicy: Retain
persistentVolumeReclaimPolicy: Delete
claimRef:
name: {{ include "hail-search.fullname" . }}-pvc
# namespace appears to default to '' here.
Expand All @@ -27,7 +27,7 @@ spec:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "hail-search.fullname" . }}-pvc
name: {{ include "hail-search.fullname" . }}-pvc-{{ print .Values.persistentVolume.volumeHandle | sha256sum | trunc 5}}
labels:
{{- include "hail-search.labels" . | nindent 4 }}
spec:
Expand Down
4 changes: 2 additions & 2 deletions unit_test/hail_search/test_hail_search_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def test_values(self):
def test_persistent_volume(self):
p = subprocess.run([*DEFAULT_ARGS, '-f', os.path.join(WORK_DIR, 'persistentvolume.yaml')], capture_output=True, text=True)
p.check_returncode()
self.assertIn('claimName: test-hail-search-pvc', p.stdout)
self.assertIn("command: ['/bin/sh', '-c', 'mkdir -p /datasets/GRCh38/SV_WES && rsync -r /ssd-datasets/GRCh38/SV_WES/annotations.ht /datasets/GRCh38/SV_WES/annotations.ht']", p.stdout)
self.assertIn('claimName: test-hail-search-pvc-9ff0a', p.stdout)
self.assertIn("command: ['/bin/sh', '-c', 'mkdir -p /datasets/GRCh38/SV_WES && cp -r /ssd-datasets/GRCh38/SV_WES/annotations.ht /datasets/GRCh38/SV_WES/annotations.ht']", p.stdout)
self.assertIn('volumeHandle: projects/test-project/zones/us-central3-a/disks/test-disk', p.stdout)

if __name__ == '__main__':
Expand Down

0 comments on commit 9a1109b

Please sign in to comment.