Skip to content

Commit 495708e

Browse files
committed
fix(confd): services check for valid config before reloading
1 parent fa9a4d8 commit 495708e

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

bin/check

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
#
3+
# Check that the configuration for deis-controller is valid.
4+
#
5+
6+
if [[ -f /templates/confd_settings.py ]] ; then
7+
set -e
8+
9+
# check that "<no value>" isn't in the templated file
10+
grep -q -v "<no value>" /templates/confd_settings.py
11+
12+
THIS_DIR=$(cd $(dirname $0); pwd) # absolute path
13+
PARENT_DIR=$(dirname $THIS_DIR)
14+
15+
# check the Django configuration file compatibility
16+
$PARENT_DIR/manage.py check > /dev/null
17+
18+
# validate the Django models
19+
$PARENT_DIR/manage.py validate > /dev/null
20+
fi

conf.d/confd_settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ keys = [
1111
"/deis/registry",
1212
"/deis/domains",
1313
]
14-
check_cmd = "test -e {{ .src }}"
14+
check_cmd = "/app/bin/check"
1515
reload_cmd = "/app/bin/reload"

0 commit comments

Comments
 (0)