Skip to content

Commit

Permalink
Merge pull request #22 from utilitywarehouse/pki-manager-if
Browse files Browse the repository at this point in the history
pki-manager: fix if statements
  • Loading branch information
ribbybibby authored Feb 18, 2020
2 parents 054e864 + b2beb3e commit 08f9663
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions vault-toolkit/vault-pki-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ while true; do
--from-file "${output_dir}"/tls.key \
--dry-run -o yaml | kubectl -n "${VAULT_NAMESPACE}" replace -f -
exit_code=$(echo $?)
if [ "${exit_code}" != "0" ];
if [ "${exit_code}" != "0" ]; then
echo "Error: failed to update secret in ${VAULT_NAMESPACE}, exiting"
exit 1
done
fi

if [[ -n "${VAULT_CLIENT_NAMESPACES}" ]]; then
echo "Updating CA in client namespaces"
Expand All @@ -125,16 +125,15 @@ while true; do
--from-file "${output_dir}"/ca.crt \
--dry-run -o yaml | kubectl -n "${n}" replace -f -
exit_code=$(echo $?)
if [ "${exit_code}" != "0" ];
if [ "${exit_code}" != "0" ]; then
echo "Error: couldn't update configmap in ${n}"
errors="true"
done
fi
done
done
if [ "${errors}" = "true" ];
fi
if [ "${errors}" = "true" ]; then
echo "Error: couldn't update configmap on one or more namespaces, exiting"
exit 1
done
fi

echo "Rotated successfully on $(date -I'seconds')"
Expand Down

0 comments on commit 08f9663

Please sign in to comment.