Skip to content

Commit

Permalink
Add home volume and adjust volume tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrancato committed Nov 29, 2019
1 parent 6936ef6 commit 87153b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ spec:
runAsUser: {{ .Values.server.uid | default 100 }}
fsGroup: {{ .Values.server.gid | default 1000 }}
volumes:
{{ template "vault.volumes" . }}
- name: temp-volume
emptyDir:
medium: Memory
{{ template "vault.volumes" . }}
- name: home-volume
emptyDir:
medium: Memory
containers:
- name: vault
{{ template "vault.resources" . }}
Expand Down Expand Up @@ -84,9 +87,11 @@ spec:
{{- include "vault.extraEnvironmentVars" .Values.server | nindent 12 }}
{{- include "vault.extraSecretEnvironmentVars" .Values.server | nindent 12 }}
volumeMounts:
{{ template "vault.mounts" . }}
- name: temp-volume
mountPath: /tmp
{{ template "vault.mounts" . }}
- name: home-volume
mountPath: /home/vault
ports:
- containerPort: 8200
name: http
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/server-dev.bats
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ load _helpers
# Volume Mounts
local volumeCount=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.containers[0].volumeMounts | length')
[ "${volumeCount}" == "0" ]
[ "${volumeCount}" == "2" ]

# Service
local service=$(kubectl get service "$(name_prefix)" --output json |
Expand Down
4 changes: 2 additions & 2 deletions test/acceptance/server.bats
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ load _helpers
# Volume Mounts
local volumeCount=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.containers[0].volumeMounts | length')
[ "${volumeCount}" == "2" ]
[ "${volumeCount}" == "4" ]

local mountName=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.containers[0].volumeMounts[0].name')
Expand All @@ -47,7 +47,7 @@ load _helpers
# Volumes
local volumeCount=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.volumes | length')
[ "${volumeCount}" == "1" ]
[ "${volumeCount}" == "3" ]

local volume=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.volumes[0].configMap.name')
Expand Down

0 comments on commit 87153b5

Please sign in to comment.