Skip to content

Commit

Permalink
typo, add test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Dec 2, 2024
1 parent 1c3eb11 commit 9a81375
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/cryostat/templates/db_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if ((.Values.db.resources.pvc).enabled) }}
{{- if ((.Values.db.pvc).enabled) }}
- name: {{ .Chart.Name }}-db
persistentVolumeClaim:
claimName: {{ .Release.Name }}-db
{{- end }}
{{- if not ((.Values.db.resources.pvc).enabled) }}
{{- if not ((.Values.db.pvc).enabled) }}
- name: {{ .Chart.Name }}-db
emptyDir: {}
{{- end }}
18 changes: 18 additions & 0 deletions charts/cryostat/tests/db_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,21 @@ tests:
path: spec.template.spec.containers[?(@.name=='cryostat-db')].imagePullPolicy
value: "IfNotPresent"

- it: should use emptyDir if PVC is not enabled
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: cryostat-db
emptyDir: {}

- it: should use PVC if enabled
set:
db.pvc.enabled: true
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: cryostat-db
persistentVolumeClaim:
claimName: RELEASE-NAME-db

0 comments on commit 9a81375

Please sign in to comment.