Skip to content

Commit 37ebe2f

Browse files
committed
add __handle_error__ trap ERR function to st2canary
1 parent 019434a commit 37ebe2f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

templates/jobs.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,9 @@ spec:
529529
# ephemeral volumes could also work, ... but that config is even deeper.
530530
command:
531531
- 'sh'
532-
- '-ec'
532+
# -e => exit on failure
533+
# -E => trap ERR is inherited in subfunctions
534+
- '-eEc'
533535
- |
534536
cat << 'INTRO'
535537
Testing write permissions for packs volumes.
@@ -538,6 +540,16 @@ spec:
538540
and then delete this st2canary pod manually.
539541
INTRO
540542
543+
function __handle_error__(){
544+
cat <<- 'FAIL'
545+
ERROR: The volumes defined in st2.packs.volumes must use ReadWriteMany (RWX) access mode
546+
so StackStorm can dynamically install packs from any of the st2actionrunner pods
547+
and have those file changes available in all of the other StackStorm pods.
548+
see: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
549+
FAIL
550+
}
551+
trap __handle_error__ ERR
552+
541553
for volume in packs virtualenvs {{ if $.Values.st2.packs.volumes.configs }}configs{{ end }}; do
542554
echo Testing write permissions on ${volume} volume...
543555
touch /opt/stackstorm/${volume}/.write-test

0 commit comments

Comments
 (0)