Skip to content

Commit e079ffa

Browse files
author
Matthew Fisher
committed
feat(contrib): allow private networked regions
1 parent 975fb1a commit e079ffa

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

contrib/digitalocean/provision-do-cluster.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
set -e
77

8+
listcontains() {
9+
for i in $1; do
10+
[[ $i = $2 ]] && echo $i && return 0
11+
done
12+
return 1
13+
}
14+
815
THIS_DIR=$(cd $(dirname $0); pwd) # absolute path
916
CONTRIB_DIR=$(dirname $THIS_DIR)
1017

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

35+
regions_with_private_networking=(4 5 6 7)
36+
if ! listcontains "$regions_with_private_networking" "$2";
37+
then
38+
echo_red "Invalid region. Please supply a region with private networking support."
39+
echo_red "Valid regions are:"
40+
echo_red "4: New York 2"
41+
echo_red "5: Amsterdam 2"
42+
echo_red "6: Singapore 1"
43+
echo_red "7: London 1"
44+
exit 1
45+
fi
46+
2847
# check that the CoreOS user-data file is valid
2948
$CONTRIB_DIR/util/check-user-data.sh
3049

0 commit comments

Comments
 (0)