Skip to content

Commit

Permalink
modules/aws/ignition/resources/s3-puller.sh: add retries to avoid races
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-M committed Jun 14, 2017
1 parent 9d45eb2 commit 83acb4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/aws/ignition/resources/s3-puller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ fi
--set-env="LOCATION=$1" \
--exec=/bin/bash -- -c '
REGION=$(wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone | sed s'/[a-zA-Z]$//')
/usr/bin/aws --region=$${REGION} s3 cp s3://$${LOCATION} /tmp/$${LOCATION//\//+}
until /usr/bin/aws --region=$${REGION} s3 cp s3://$${LOCATION} /tmp/$${LOCATION//\//+}; do
echo "Could not pull from S3, retrying in 5 seconds ($i)"
sleep 5
done
'

/usr/bin/sudo mv /tmp/$${1//\//+} $2

0 comments on commit 83acb4d

Please sign in to comment.