Skip to content

Commit

Permalink
Merge pull request coreos#1072 from Quentin-M/s3_retry
Browse files Browse the repository at this point in the history
modules/aws/ignition/resources/s3-puller.sh: add retries to avoid races
  • Loading branch information
Quentin-M authored Jun 14, 2017
2 parents 058cba9 + 83acb4d commit 2592040
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 2592040

Please sign in to comment.