From 9d25f8c06c9848115605285e96b4b3990e642054 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 30 Jul 2013 11:33:06 -0400 Subject: [PATCH] fix(dev-db/etcd): Handle missing ec2 user-data correctly. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Important notice to all using curl: by default a 404 is not an error! I noticed that instances created without any user data were attempting to connect to a *lot* of random IP addresses and failing. After attempting the curl command c10n uses to fetch user data it would seem we have lots of virtual machines using the following as a secret key: 404 - Not Found

404 - Not Found

ᕙ(⇀‸↼‶)ᕗ The --fail option is required for curl to behave responsibly. --- .../third_party/coreos-overlay/dev-db/etcd/files/coreos-c10n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/coreos-c10n b/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/coreos-c10n index e264dd9079..c9f00a9e7f 100755 --- a/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/coreos-c10n +++ b/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/coreos-c10n @@ -9,7 +9,7 @@ ETCD_BOOTSTRAP="/var/run/etcd/bootstrap.config" /usr/bin/block-until-url $C10N_ENDPOINT /usr/bin/block-until-url $META_URL -USER_DATA=$(curl -s $META_URL/user-data) +USER_DATA=$(curl -s --fail $META_URL/user-data) if [ $? -eq 0 ] && [ ! -z "$USER_DATA" ]; then URL=$USER_DATA