Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3516 from bacongobbler/3483-fix-generate-certs
Browse files Browse the repository at this point in the history
fix(router): write out only if cert matches the path
  • Loading branch information
Matthew Fisher committed Apr 17, 2015
2 parents 4bd9eaf + bf7100f commit 02b78a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions router/image/templates/generate-certs
Expand Up @@ -27,13 +27,17 @@ while read etcd_path; do
{{ range $cert := .deis_certs }}{{ if $cert.Nodes }}
{{ range $certFields := $cert.Nodes }}
{{ if eq (Base $certFields.Key) "cert" }}
if [[ "$(basename $etcd_path)" == "{{ Base $cert.Key }}" ]]; then
cat << EOF > "$CERT_PATH/$(basename $etcd_path).cert"
{{ $certFields.Value }}
EOF
fi
{{ else if eq (Base $certFields.Key) "key" }}
if [[ "$(basename $etcd_path)" == "{{ Base $cert.Key }}" ]]; then
cat << EOF > "$KEY_PATH/$(basename $etcd_path).key"
{{ $certFields.Value }}
EOF
fi
{{ end }}
{{ end }}
{{ end }}{{ end }}
Expand Down

0 comments on commit 02b78a2

Please sign in to comment.