Skip to content

Commit

Permalink
feat(contrib): allow private networked regions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Fisher committed Jul 24, 2014
1 parent 975fb1a commit e079ffa
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions contrib/digitalocean/provision-do-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@

set -e

listcontains() {
for i in $1; do
[[ $i = $2 ]] && echo $i && return 0
done
return 1
}

THIS_DIR=$(cd $(dirname $0); pwd) # absolute path
CONTRIB_DIR=$(dirname $THIS_DIR)

Expand All @@ -25,6 +32,18 @@ if [ -z "$DEIS_NUM_INSTANCES" ]; then
DEIS_NUM_INSTANCES=3
fi

regions_with_private_networking=(4 5 6 7)
if ! listcontains "$regions_with_private_networking" "$2";
then
echo_red "Invalid region. Please supply a region with private networking support."
echo_red "Valid regions are:"
echo_red "4: New York 2"
echo_red "5: Amsterdam 2"
echo_red "6: Singapore 1"
echo_red "7: London 1"
exit 1
fi

# check that the CoreOS user-data file is valid
$CONTRIB_DIR/util/check-user-data.sh

Expand Down

0 comments on commit e079ffa

Please sign in to comment.