Merge pull request #6090 from gas-buddy/eherot/autoscaler_curl_support

Automagically use curl instead of wget if that's what's available
This commit is contained in:
Kubernetes Prow Robot 2018-12-20 22:06:14 -08:00 committed by GitHub
commit 323b51ac54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -93,7 +93,16 @@ aws iam attach-role-policy --policy-arn $ASG_POLICY_ARN --role-name $IAM_ROLE
printf " ✅ \n"
addon=cluster-autoscaler.yml
wget -O ${addon} https://raw.githubusercontent.com/kubernetes/kops/master/addons/cluster-autoscaler/v1.8.0.yaml
manifest_url=https://raw.githubusercontent.com/kubernetes/kops/master/addons/cluster-autoscaler/v1.8.0.yaml
if [[ $(which wget) ]]; then
wget -O ${addon} ${manifest_url}
elif [[ $(which curl) ]]; then
curl -s -o ${addon} ${manifest_url}
else
echo "No curl or wget available. Can't get the manifest."
exit 1
fi
sed -i -e "s@{{CLOUD_PROVIDER}}@${CLOUD_PROVIDER}@g" "${addon}"
sed -i -e "s@{{IMAGE}}@${IMAGE}@g" "${addon}"