Skip to content

Commit bf7100f

Browse files
author
Matthew Fisher
committed
fix(router): write out only if cert matches the path
1 parent 54757a0 commit bf7100f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

router/image/templates/generate-certs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ while read etcd_path; do
2727
{{ range $cert := .deis_certs }}{{ if $cert.Nodes }}
2828
{{ range $certFields := $cert.Nodes }}
2929
{{ if eq (Base $certFields.Key) "cert" }}
30+
if [[ "$(basename $etcd_path)" == "{{ Base $cert.Key }}" ]]; then
3031
cat << EOF > "$CERT_PATH/$(basename $etcd_path).cert"
3132
{{ $certFields.Value }}
3233
EOF
34+
fi
3335
{{ else if eq (Base $certFields.Key) "key" }}
36+
if [[ "$(basename $etcd_path)" == "{{ Base $cert.Key }}" ]]; then
3437
cat << EOF > "$KEY_PATH/$(basename $etcd_path).key"
3538
{{ $certFields.Value }}
3639
EOF
40+
fi
3741
{{ end }}
3842
{{ end }}
3943
{{ end }}{{ end }}

0 commit comments

Comments
 (0)