Skip to content

Commit f9c02a6

Browse files
committed
fix(router): disable watch
1 parent 7c48f4b commit f9c02a6

2 files changed

Lines changed: 12 additions & 24 deletions

File tree

router/boot.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func waitForInitialConfd(etcd string, timeout time.Duration) {
115115
var buffer bytes.Buffer
116116
output := bufio.NewWriter(&buffer)
117117
log.Debugf("Connecting to etcd server %s", etcd)
118-
cmd := exec.Command("confd", "-node", etcd, "--confdir", "/app", "-onetime", "--log-level", "debug")
118+
cmd := exec.Command("confd", "-node", etcd, "--confdir", "/app", "-onetime", "--log-level", "error")
119119
cmd.Stdout = output
120120
cmd.Stderr = output
121121

@@ -132,7 +132,7 @@ func waitForInitialConfd(etcd string, timeout time.Duration) {
132132
}
133133

134134
func launchConfd(etcd string) {
135-
cmd := exec.Command("confd", "-node", etcd, "--confdir", "/app", "--log-level", "debug", "--watch")
135+
cmd := exec.Command("confd", "-node", etcd, "--confdir", "/app", "--log-level", "error", "--interval", "5")
136136
cmd.Stdout = os.Stdout
137137
cmd.Stderr = os.Stderr
138138

router/image/templates/generate-certs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# create or truncate the file
44
> /etc/ssl/deis_certs
55

6-
{{ range $cert := .deis_certs }}
7-
echo {{ $cert.Key }} >> /etc/ssl/deis_certs
6+
{{ range $cert := ls "/deis/certs" }}
7+
echo {{ $cert }} >> /etc/ssl/deis_certs
88
{{ end }}
99

1010
CERT_PATH=/etc/ssl/deis/certs
@@ -19,26 +19,14 @@ mkdir -p $CERT_PATH
1919
mkdir -p $KEY_PATH
2020

2121
while read etcd_path; do
22-
ETCD_SLUG=".$(echo $etcd_path | sed s/\\/// | sed s/\\//_/g)"
23-
ETCD_CERT_SLUG="${ETCD_SLUG}_cert"
24-
ETCD_KEY_SLUG="${ETCD_SLUG}_key"
25-
26-
# cert template
27-
{{ range $cert := .deis_certs }}{{ if $cert.Nodes }}
28-
{{ range $certFields := $cert.Nodes }}
29-
{{ if eq (Base $certFields.Key) "cert" }}
30-
if [[ "$(basename $etcd_path)" == "{{ Base $cert.Key }}" ]]; then
31-
cat << EOF > "$CERT_PATH/$(basename $etcd_path).cert"
32-
{{ $certFields.Value }}
22+
{{ range $cert := ls "/deis/certs" }}
23+
if [[ "$etcd_path" == "{{ $cert }}" ]]; then
24+
cat << EOF > "$CERT_PATH/$etcd_path.cert"
25+
{{ getv (printf "/deis/certs/%s/cert" $cert) }}
3326
EOF
34-
fi
35-
{{ else if eq (Base $certFields.Key) "key" }}
36-
if [[ "$(basename $etcd_path)" == "{{ Base $cert.Key }}" ]]; then
37-
cat << EOF > "$KEY_PATH/$(basename $etcd_path).key"
38-
{{ $certFields.Value }}
27+
cat << EOF > "$KEY_PATH/$etcd_path.key"
28+
{{ getv (printf "/deis/certs/%s/key" $cert) }}
3929
EOF
40-
fi
41-
{{ end }}
42-
{{ end }}
43-
{{ end }}{{ end }}
30+
fi{{ end }}
4431
done < /etc/ssl/deis_certs
32+

0 commit comments

Comments
 (0)