Skip to content

Commit fcadd48

Browse files
feat(controller): Toggle registration using etcd
Allow to disable or enable the registration using an etcd setting.
1 parent fa92f72 commit fcadd48

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

controller/bin/boot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if ! etcdctl --no-sync -C $ETCD ls $ETCD_PATH >/dev/null 2>&1; then
2929
etcdctl --no-sync -C $ETCD set $ETCD_PATH/protocol ${DEIS_PROTOCOL:-http} >/dev/null
3030
etcdctl --no-sync -C $ETCD set $ETCD_PATH/secretKey ${DEIS_SECRET_KEY:-`openssl rand -base64 64 | tr -d '\n'`} >/dev/null
3131
etcdctl --no-sync -C $ETCD set $ETCD_PATH/builderKey ${DEIS_BUILDER_KEY:-`openssl rand -base64 64 | tr -d '\n'`} >/dev/null
32+
etcdctl --no-sync -C $ETCD set $ETCD_PATH/registrationEnabled True >/dev/null
3233
fi
3334

3435
# wait for confd to run once and install initial templates

controller/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
max-line-length = 99
3-
exclude = */api/migrations/*,*/build/*,*/venv/*,*/virtualenv/*,*/scheduler/*
3+
exclude = */api/migrations/*,*/build/*,*/venv/*,*/virtualenv/*,*/scheduler/*,*/templates/*
44
max-complexity = 12

controller/templates/confd_settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@
2424

2525
# move log directory out of /app/deis
2626
DEIS_LOG_DIR = '/var/log/deis'
27+
28+
{{ if .deis_controller_registrationEnabled }}
29+
REGISTRATION_ENABLED = {{ .deis_controller_registrationEnabled }}
30+
{{ end }}

0 commit comments

Comments
 (0)