Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Commit b1d896f

Browse files
committed
fixed validator for loval volumes
1 parent f7effaa commit b1d896f

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

local-volumes/templates/mkdir-pod.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ metadata:
3030
chart: "{{ $.Chart.Name }}-{{ $.Chart.Version }}"
3131
release: "{{ $.Release.Name }}"
3232
heritage: "{{ $.Release.Service }}"
33+
annotations:
34+
# This is what defines this resource as a hook. Without this line, the
35+
# job is considered part of the release.
36+
"helm.sh/hook": post-install
37+
"helm.sh/hook-weight": "-5"
38+
"helm.sh/hook-delete-policy": hook-succeeded
3339
spec:
3440
restartPolicy: Never
3541
nodeSelector:

run-validator.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RELEASE_STATUS=$(helm status $RELEASE 2>/dev/null | awk -F': ' '$1 == "STATUS" {
4040
if [[ -n "${RELEASE_STATUS}" ]]; then
4141
echo "There is a previous run of $RELEASE with status $RELEASE_STATUS , deleting it"
4242
helm delete $RELEASE --purge
43+
sleep 10
4344
fi
4445

4546
HELM=${HELM:-helm}

validator/templates/storageclasses/pvcs.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,35 @@ metadata:
6262
name: test-pvc-{{ $v.existingPvc }}
6363
labels:
6464
app: {{ $.Release.Name }}
65+
annotations:
66+
# This is what defines this resource as a hook. Without this line, the
67+
# job is considered part of the release.
68+
"helm.sh/hook": post-install
69+
"helm.sh/hook-weight": "-5"
70+
"helm.sh/hook-delete-policy": hook-succeeded
6571
spec:
72+
restartPolicy: Never
73+
terminationGracePeriodSeconds: 10
6674
containers:
6775
- image: alpine:3.7
6876
name: test-pvc-{{ $v.existingPvc }}
6977
imagePullPolicy: IfNotPresent
7078
volumeMounts:
71-
- mountPath: /data
79+
- mountPath: /test-pvc
7280
name: data
81+
command:
82+
- sh
83+
- -c
84+
- |
85+
mount
86+
ls -l /test-pvc
87+
mkdir -pv /test-pvc/test-pvc
88+
sleep 300
7389
readinessProbe:
7490
exec:
7591
command:
76-
- touch
77-
- /data/tst1
92+
- touch
93+
- /test-pvc/test-pvc/ready
7894
initialDelaySeconds: 1
7995
periodSeconds: 3
8096
volumes:
@@ -87,4 +103,13 @@ spec:
87103
{{- end }}
88104
---
89105
{{- end -}}
106+
107+
apiVersion: v1
108+
kind: ConfigMap
109+
metadata:
110+
name: test-pvc-dummy-cm
111+
labels:
112+
app: {{ $.Release.Name }}
113+
data:
114+
dd: "11"
90115
{{- end -}}

values.yaml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ mongodb:
6161
postgresql:
6262
storageSize: 8Gi
6363
storageClass:
64-
#existingPvc: cf-postgesql
64+
#existingPvc: cf-postgresql
6565
#nodeSelector:
6666
# kubernetes.io/hostname: storage-host-01
6767

6868
consul:
6969
storageSize: 1Gi
7070
storageClass:
71-
#existingPvc: cf-consul
71+
#existingPvc: cf-consul-0
7272
#nodeSelector:
7373
# kubernetes.io/hostname: storage-host-01
7474

0 commit comments

Comments
 (0)