update logging, retries and allow setting number of retries for vault component
Closes #281 (closed)
Update initialize-gun.sh
to retry vault login, retrieving the root key, and adding the target key to vault. Tested sections of added logic locally to not impact prod notary/vault.
Script used to test some of the logic
for i in $(seq 1 $NUM_RETRIES); do
if [ -n "${TEST_TOKEN:-}" ]; then
if ! curl -f -LO "${TEST_TOKEN}"; then
echo "failed to curl, retrying"
TEST_TOKEN=<working_link>
echo "${TEST_TOKEN}"
continue
else
echo "successfully curled"
break
fi
else
echo $i
fi
if [ $i -eq 3 ]; then
TEST_TOKEN=<broken_link>
echo "${TEST_TOKEN}"
fi
done
Edited by ariel.shnitzer